0
votes
0
comments
2,398
views

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

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
5,782
views

Mac OS X Terminal Colors

0 votes, 0.00 avg. rating (0% score)
I’m new to Mac having just got one after working with Ubuntu Linux for some time. Among the many things I’m trying to figure out is absence of colors in my the terminal window – like the ones that are shown (on linux) when you run ‘ls -la’ or ‘git status’… I just can’t figure […]
0
votes
0
comments
683
views

List the number of lines in files

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
786
views

Need to improve urlencode function

0 votes, 0.00 avg. rating (0% score)
I need a way to URL encode strings with a shell script on a OpenWRT device running old version of busybox. Right now I ended up with the following code: This works more or less fine but there’re a few flaws: Some characters are skipped, like “”, for example. Result is return character by character […]
1
votes
0
comments
758
views

Shell: File and Directory Testing

1 vote, 4.00 avg. rating (50% score)
Trying to find out if a file or a directory exists within a shell program is pretty easy. You may also want to test if the directory is a symlink or if the file is executable. Here are a few tips to perform some various validation tasks.
0
votes
0
comments
1,395
views

A little help redirecting stderr to stdout

0 votes, 0.00 avg. rating (0% score)
When writing shell scripts, there are times when I want to have the output captured and redirected into a file. Noticing that error messages from the script such as possible syntax errors are not written to the output file. This is because stderr and stdout are 2 separate file handles. Think of it as you […]