shell basics Flashcards
ls
lists directory contents
ls -l
uses long listing format
ls -v
explains what is being done
mkdir -p
makes parents
rmdir -p
removes dir and its ancestors
mkdir
makes dir
rmdir
removes empty dir
rm
removes files and dir
rm -r
removes dir and their contents recursively
rm -i
checks before every removal
cp
copies files and dir
cp -r
copies recursively
cp -v
explains what is being done
mv
moves(renames) files
mv -v
explains what is being done
touch
changes file timestamps; creates new file if it doesn’t exist
touch -c
doesn’t create new files
touch -a
only changes access time
touch -m
only changes modificiation time
touch -t
changes time to [[CC]MMDDhhmm[.ss] instead of current time
cat
concatenates files and prints on the standard output
cat
prints on the standard output
cat -n
numbers all output lines
cat -s
suppresses repeated empty output lines
cat -T
displays TAB char as ^I
wc
prints newline, word and byte count
wc -c
bytes
wc -l
lines
wc -w
words
grep
matches patterns
cut
removes sections from each line of files
sort
sorts lines
sort -v
explains what is being done
sort -u
uniq
sort -r
reverse
sort -n
numeric sort
cut -d
delimiter
cut -f
field
cut -c
only these chaarcters
tr
translate or delete char
tr -d
delete char in SET1
tr -c
use the complement of SET1
tr -t
first truncate SET1 to length of SET2
echo
displays a line of text
echo -n
suppresses trailing newline
echo -e
enable interpretation of backslash escapes
echo -E
disable interpretation of backslash escapes (default)
> -
save
<-
read
> >
append
«
here-doc
«<
here-string
sort -t “”
field separator
uniq -d
display only the duplicate lines
uniq -c