0
votes
0
comments
2,412
views
How to can i log all commands typed in a Bash shell?
Our small company runs an Ubuntu Server 11.10, to which a couple of people have SSH access. The actual terminals are sometimes used, too. How can we locally log all Bash commands run, along with user and time stamp? We can assume that no-one is nefarious and actively trying to avoid the logging, but we’d […]0
votes
0
comments
1,235
views
grep files from list
I am trying to run grep against a list of a few hundred files: $ head -n 3 <(cat files.txt) admin.php ajax/accept.php ajax/add_note.php However, even though I am grepping for a string that I know is found in the files, the following does not search the files: $ grep -i 'foo' <(cat files.txt) $ grep […]0
votes
0
comments
1,226
views
grep inside less?
I’m currently sifting through a lot of unfamiliar logs looking for some issues. The first file I look at is Events.log, and I get at least three pages in less which appear to display the same event at different times – an event that appears to be fairly benign. I would like to filter this […]0
votes
0
comments
690
views
List the number of lines in files
How can I list the number of lines in the files in /group/book/four/word, sorted by the number of lines they contain? “ls -l” command lists them down but does not sort them terdon You should use a command like this: find /group/book/four/word/ -type f -exec wc -l {} + | sort -rn find : search […]0
votes
0
comments
4,802
views
find and remove duplicates in a directory
I have a directory with multiple img files and some of them are identical but they all have different names. I need to remove duplicates but with no external tools only with a bash script. I’m a beginner in Linux. I tried nested for loop to compare md5 sums and depending on the result remove […]0
votes
0
comments
1,100
views