Most viewed posts
LINUX COMMANDS
Search
System Administration
Linux Command: alias
Commonly used for a long strings that are frequently used. Alias allows you to have a small more familiar command or name to execute a long string.
Linux Commad Options:
name Specifies the alias name.
command Specifies the command the name should be an alias for.
Common use::
Set home to type cd public_html
$ alias home 'cd public_html'
Linux Command: ps
ps [options]
Common use::
| $ ps -e -o pid,args --fores | List processes in a hierarchy |
| $ ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d' | List processes by % cpu usage |
| $ ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS | List processes by mem (KB) usage. |
Linux Command: grep
grep [options] pattern [files]
Search one or more files for lines that match a regular expression pattern. Regular expressions are described in Chapter 7. Exit status
is 0 if any lines match, 1 if none match, and 2 for errors. See also egrep and fgrep.
Common use::
| $ grep -c /bin/tcsh /etc/passwd | List the number of users who use tcsh |
| $ grep -F capacity: /proc/acpi/battery/BAT0/info | Show state of cells in laptop battery |
| $ grep "model name" /proc/cpuinfo | Show CPU(s) info |
| $ grep -l '^#include' /usr/include/* | List header files that have at least one #include directive |
| $ grep MemTotal /proc/meminfo | Show RAM total seen by the system |