0
votes
0
comments
411
views

How to can i log all commands typed in a Bash shell?

  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)
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
736
views

grep files from list

  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)
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
426
views

grep inside less?

  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)
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
347
views

List the number of lines in files

  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)
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
2,894
views

find and remove duplicates in a directory

  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)
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
791
views

Bash vs ksh pipes

  • 0.00 / 5 5
0 votes, 0.00 avg. rating (0% score)
I am stuck with some problems with my scripts in ksh. FWIW the problem which I am unable to overcome is that when I use a structure such as this command | while read VAR1 do many.commands using $VAR1 done I often get that my scripts do not perform the loop for every line piped […]