man
command
Path | Explanation |
---|---|
alpha | a file in your current directory |
beta/gamma | a file in the beta directory, which is in your current directory |
/delta/epsilon | a file in the delta directory, which is inside the root directory. |
. | the current directory |
.. | the parent directory, one level up |
/ | the root directory |
~ | your home directory (only known to the shell, not in a program) |
~zeta | User zeta’s home directory (only known to the shell, not in a program) |
$ cd ~/tmp $ pwd /s/bach/a/class/ct320/tmp $ ls backup-2019 final.csv IQ04.csv IQ07.csv IQ11.csv IQ15.csv TLD-save ch IQ01.csv IQ04-old.csv IQ08.csv IQ12.csv Music.ico vars enrolled IQ02.csv IQ05.csv IQ09.csv IQ13.csv r7 z FINAL IQ03.csv IQ06.csv IQ10.csv IQ14.csv st $ ls ~/bin checkin curve imv p scores wikidiff checkin-checker demo-script l peek stats wikiedit checkin-file-checker domoss ll playpen tools wikigrep checkin_prog e lsf pwget u wikiupdate chit grade moss ruler unold wikiwhence cls grade-busy new run untar code grade-file-checker note runner vman cronedit grades old save wikicat $ mkdir zulu $ cd zulu $ pwd /s/bach/a/class/ct320/tmp/zulu $ cd $ pwd /s/bach/a/class/ct320 $ rmdir tmp/zulu
cd
path — change current directory
ls
path — list current (specified) directory
pwd
— show current directory
mkdir
path — create a new directory
rmdir
path — remove a (empty) directory
cat
, less
, more
file — display file contents
vi
, gedit
file — edit file contents
cp
path path — copy file or directory
mv
path path — move (rename) file or directory
rm
path — remove file or directory
diff
path path — compare file or directory
$ date >now $ ls -l now -rw------- 1 ct320 class 29 Nov 22 02:00 now $ chmod -w now $ ls -l now -r-------- 1 ct320 class 29 Nov 22 02:00 now $ echo "hi" >now /tmp/pmwiki-bash-scriptBe3gyO: line 18: now: Permission denied
chmod
permissions path — change permissions
chown
owner path — change (user) ownership
chgrp
group path — change (group) ownership
ps
— display running processes
kill
— terminate running processes
bg
, fg
, nice
— process control commands
shutdown
time — system shutdown
reboot
— system reboot
date
— system date and time
time
command — measures command timing
whereis
command — find command instances
dmesg
— system boot messages
>
to create/overwrite with stdout, >>
to append, <
for stdin
$ echo "hello" >foo $ echo "Zeta Eta Theta" >foo $ date >>foo $ cat foo Zeta Eta Theta Fri Nov 22 02:00:05 MST 2024
$ echo "hello" >foo $ echo "Zeta Eta Theta" >foo $ date >>foo $ cat foo Zeta Eta Theta Fri Nov 22 02:00:05 MST 2024 $ cat foo | sort Fri Nov 22 02:00:05 MST 2024 Zeta Eta Theta $ sort <foo Fri Nov 22 02:00:05 MST 2024 Zeta Eta Theta $ sort foo Fri Nov 22 02:00:05 MST 2024 Zeta Eta Theta
ls | less
find . -name temp.dat | grep -v zulu
set -o vi
or set -o emacs
history
— shows previous commands
sort
— sort input line to output lines
-b
: ignore white space
-f
: case insenstive sorting
-n
: compare fields as numbers
-r
: reverse sort order
-k
: specify sorting column
uniq
— print unique lines (cull duplicates)
tee
— copy input to two places
head
, tail
— print beginning or head of file
grep
"regular-expression" — search for text
Modified: 2017-08-20T15:30 User: Guest Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |