list of ~10 Linux commands that can be useful

tags:

A comprehensive list of Linux commands would be a long one! Here are ~10 commands that can be useful, with usage scenarios from scientific computing. (Note that the venerable rsync command has its own page.)

finger► info on users currently logged in
always nice to know who else is running jobs on the cluster
head► display first few lines of a file or text stream
when compiler barfs error messages, pipe to head and start debugging with the first one!
history► display list of previously issued commands
combines well with grep to quickly isolate that hard-to-remember command
ldd► list shared libraries on which an executable depends
great for troubleshooting those pesky errors in the linking portion of the compile-link process
readlink -f► display a file or directory's absolute path
in most terminals, double-clicking will highlight the path for copying to the clipboard
sed► perform transformation on input text stream
can be used with regular expressions and the -i flag to update, say, a filepath present in multiple files
sort► sort lines of a file or text stream in a specified order
sort -n is especially useful when dealing with numerical data
tail -f► display end of file, with updates
with -f, tail will monitor, e.g., output data file, displaying new data as it's appended
tee► write standard input to both standard output and a file
when compiling a large piece of software, use tee to both loosely monitor for errors and save complete record
top► show real-time statistics of system resource usage by process
great for checking freshly written code for memory leaks!
wc -l► count lines in file or text stream
great for checking that an output data file has the expected length
xargs► build commands to execute from standard input
can be used with ls to, e.g., run a script on each of a subset of files in a directory