Shell¶
Tip
You can loop up information about commands by executing:
$ man <name>
For example, to lookup ls
execute:
$ man ls
Information¶
uname
display operating system namedate
display the dateuptime
show how long the operating system has been runningwhoami
show the current user idman
display the manual page for a command
Directory Operations¶
pwd
display working directorymkdir
make a directorycd
change directoryls
list directory contents
ls
Options¶
-a
include directory entries whose name begins with a.
-R
recuresively list subdirectories encountered-r
reverse the order of the sort-t
sort by time modified-S
sort files by size-l
list in log format-1
output one entry per line-m
list files accross the page separated by commas-Q
enclose entry names in double quotes
Searching¶
grep
print lines matching a patternfind dir -name "pattern"
searchdir
for files matchingpattern
find dir -iname "pattern"
the above but ignore casewhereis
locate the binary, source, manual page files for a commandlocate
find files by name
grep
Options¶
-i
ignore case-r
recursive-v
select non-matching lines-o
show only the matching part of matching lines
File Operations¶
touch
change file timestampscat
concatenate files and print tostdout
more
file perusal filter for viewingless
likemore
but supports backward movementfile
determine file typecp
copy files and directoriesmv
move (rename) filesrm
remove files or directorieshead
display the first lines of filestail
display the last lines of fileschmod
change file access permissions
Process Management¶
ps
report a snapshot of current processestop
display linux process tablekill
terminate a process using process idpgrep
lookup process based on namepkill
kill process based on namekillall
kill processes by name