cat |
cat > f |
create file f and wait for keyboard (see ^D) |
|
cat f |
stream contents of file f to STDOUT |
|
cat a b > c |
concatenate files a and b into c |
cd |
cd d |
change to relative directory d |
|
cd .. |
go up one directory |
|
cd /d |
change to absolute directory d |
chmod |
chmod 644 f |
change permissions for file f in octal format |
|
chmod u+x f |
change permissions for f the hard way |
cp |
cp f1 f2 |
make a copy of file f1 called f2 |
cut |
cut -f 2,3 |
cut columns out of a file |
date |
date |
print the current date |
df |
df -h . |
display free space on file system |
du |
du -h ~ |
display the sizes of your files |
git |
git add f |
start tracking file f |
|
git commit -m "message" |
finished edits, ready to upload |
|
git push |
put changes into repository |
|
git pull |
retrieve latest documents from repository |
|
git status |
check on status of repository |
grep |
grep p f |
print lines with the letter p in file f |
gzip |
gzip f |
compress file f |
gunzip |
gunzip f.gz |
uncompress file f.gz |
head |
head f |
display the first 10 lines of file f |
|
head -2 f |
display the first 2 lines of file f |
history |
history |
display the recent commands you typed |
htop |
htop |
more extensive version of top |
kill |
kill 1023 |
kill process with id 1023 |
less |
less f |
page through a file |
ln |
ln -s f1 f2 |
make f2 an alias of f1 |
ls |
ls |
list current directory |
|
ls -F |
show file types |
|
ls -Fl |
list with file details |
|
ls -Fla |
also show invisible files |
|
ls -Flta |
sort by time instead of name |
man |
man ls |
read the manual page on ls command |
mkdir |
mkdir d |
make a directory named d |
more |
more f |
page through file f (see less) |
mv |
mv foo bar |
rename file foo as bar |
|
mv foo .. |
move file foo to parent directory |
nano |
nano |
use the nano text file editor |
pwd |
pwd |
print working directory |
rm |
rm f1 f2 |
remove files f1 and f2 |
|
rm -r d |
remove directory d and all files beneath |
|
rm -rf / |
destroy your computer |
rmdir |
rmdir d |
remove directory d |
sort |
sort f |
sort file f alphabetically by first column |
|
sort -n f |
sort file f numerically by first column |
|
sort -k 2 f |
sort file f alphabetically by column 2 |
tail |
tail f |
display the last 10 lines of file f |
|
tail -f f |
as above and keep displaying if file is open |
tar |
tar -cf ... |
create a compressed tar-ball (-z to compress) |
|
tar -xf ... |
decompress a tar-ball (-z if compressed) |
time |
time ... |
determine how much time a process takes |
top |
top |
display processes running on your system |
touch |
touch f |
update file f modification time (create if needed) |
wc |
wc f |
count the lines, words, and characters in file f |
screen |
screen -S ... |
start a virtual terminal |