1 EXPERIMENT 1
Aim
Getting started with Linux basic commands for directory operations, displaying directory structure in tree format
etc.
1.1 Command 1: ps
Purpose
report a snapshot of the current processes
Usage
ps
ps -e
ps -ejH
Sample i/p and o/p
1.2 Command 2: pstree
Purpose
display a tree of processes
Usage
pstree
pstree -T
pstree -s
Sample i/p and o/p
1.3 Command 3: strace
Purpose
trace system calls and signals
Usage
strace [command name]
Sample i/p and o/p
1.4 Command 4: gdb
Purpose
The GNU Debugger
Usage
gdb [Executable filename]
Sample i/p and o/p
1.5 Command 5: strings
Purpose
print the sequences of printable characters in files
Usage
strings [filename]
strings [filename] -f
strings [filename] -d
Sample i/p and o/p
1.6 Command 6: objdump
Purpose
display information from object files
Usage
objdump -S [filename]
objdump -s [filename]
objdump -f [filename]
Sample i/p and o/p
1.7 Command 7: nm
Purpose
list symbols from object files
Usage
nm -g
Sample i/p and o/p
1.8 Command 8: file
Purpose
determine file type
Usage
file [filename]
file [filename] -b
file [filename] -F [seperator]
Sample i/p and o/p
1.9 Command 9: od
Purpose
dump files in octal and other formats
Usage
od
od [filename]
od [filename] -i
Sample i/p and o/p
1.10 Command 10: xxd
Purpose
make a hexdump or do the reverse.
Usage
xxd
xxd [filename]
xxd -l [len] [ filename]
Sample i/p and o/p
1.11 Command 11: fuser
Purpose
identify processes using files or sockets
Usage
fuser -l
Sample i/p and o/p
1.12 Command 12: top
Purpose
display Linux processes
Usage
top
Sample i/p and o/p
1.13 Command 13: awk
Purpose
pattern scanning and processing language
Usage
gawk -F: ’{ print $1 }’ /etc/passwd
Sample i/p and o/p
1.14 Command 14: cal
Purpose
displays a calendar and the date of Easter
Usage
cal
cal -m [month]
cal -3
Sample i/p and o/p
1.15 Command 15: ls
Purpose
list directory contents
Usage
ls
ls -a
ls -A
Sample i/p and o/p
1.16 Command 16: chmod
Purpose
change file mode bits
Usage
chmod +x [filename]
chmod +r [filename]
chmod +w [filename]
Sample i/p and o/p
output.error.png
1.17 Command 17: chown
Purpose
change file owner and group
Usage
<usage>
Sample i/p and o/p
command.error.png
1.18 Command 18: chgrp
Purpose
change group ownership
Usage
<usage>
Sample i/p and o/p
command.error.png
1.19 Command 19: mkdir
Purpose
make directories
Usage
mkdir [directory name]
Sample i/p and o/p
1.20 Command 20: rmdir
Purpose
remove empty directories
Usage
rmdir [directory name]
Sample i/p and o/p
1.21 Command 21: locate
Purpose
find files by name, quickly
Usage
locate [command name]
Sample i/p and o/p
1.22 Command 22: nftw
Purpose
Usage
<usage>
Sample i/p and o/p
command.error.png
1.23 Command 23: touch
Purpose
change file timestamps
Usage
touch [filename]
Sample i/p and o/p
1.24 Command 24: cat
Purpose
concatenate files and print on the standard output
Usage
cat
cat [filename a] [filename b]
cat [filename a] [filename b] -E
Sample i/p and o/p
1.25 Command 25: more
Purpose
file perusal filter for crt viewing
Usage
more [filename]
Sample i/p and o/p
1.26 Command 26: less
Purpose
opposite of more
Usage
less [filename]
Sample i/p and o/p
1.27 Command 27: cp
Purpose
copy files and directories
Usage
cp [filename] [copyfilename]
Sample i/p and o/p
1.28 Command 28: mv
Purpose
move (rename) files
Usage
mv [old filename] [new filename]
Sample i/p and o/p
1.29 Command 29: rm
Purpose
remove files or directories
Usage
rm [filename]
Sample i/p and o/p
1.30 Command 30: grep
Purpose
print lines that match patterns
Usage
man grep | grep description
Sample i/p and o/p
1.31 Command 31: tail
Purpose
output the last part of files
Usage
tail [filename]
tail [filename] -n 4
tail [filename] -c 10
Sample i/p and o/p
1.32 Command 32: head
Purpose
display first lines of a file
Usage
head [filename]
head [filename] -n 4
head [filename] -c 10
Sample i/p and o/p
1.33 Command 33: find
Purpose
search for files in a directory hierarchy
Usage
find [filename]
Sample i/p and o/p
1.34 Command 34: sort
Purpose
sort lines of text files
Usage
sort [filename]
sort -r [filename]
Sample i/p and o/p
1.35 Command 35: stty
Purpose
change and print terminal line settings
Usage
stty
stty -a
Sample i/p and o/p
1.36 Command 36: sed
Purpose
stream editor for filtering and transforming text
Usage
sed ’s/a/b/g’ [filename]
Sample i/p and o/p
1.37 Command 37: uniq
Purpose
report or omit repeated lines
Usage
uniq [filename]
uniq [filename] -c
uniq [filename] -d
Sample i/p and o/p
1.38 Command 38: du
Purpose
estimate file space usage
Usage
du
du -sh
du -b
Sample i/p and o/p
1.39 Command 39: df
Purpose
report file system disk space usage
Usage
df
df -h
Sample i/p and o/p
1.40 Command 40: man
Purpose
an interface to the system reference manuals
Usage
man man
man -k debugger
man -f [name]
Sample i/p and o/p
1.41 Command 41: help
Purpose
Display information about builtin commands.
Usage
help [command]
Sample i/p and o/p
1.42 Command 42: pr
Purpose
convert text files for printing
Usage
pr [filename]
pr [filename] -d
pr [filename] -n
Sample i/p and o/p
1.43 Command 43: tr
Purpose
translate or delete characters
Usage
tr [set1] [set2]
tr -c [set1] [set2]
Sample i/p and o/p
output.error.png
1.44 Command 44: diff
Purpose
compare files line by line
Usage
diff [filename a] [filename b]
diff [filename a] [filename b] -s
diff [filename a] [filename b] -y
Sample i/p and o/p
1.45 Command 45: wc
Purpose
print newline, word, and byte counts for each file
Usage
wc [filename]
wc [filename] -c
wc [filename] -l
wc [filename] -L
Sample i/p and o/p
1.46 Command 46: bc
Purpose
compress or expand files
Usage
bc
Sample i/p and o/p
1.47 Command 47: gzip
Purpose
compress or expand files
Usage
gzip [filename]
Sample i/p and o/p
1.48 Command 48: history
Purpose
GNU History Library
Usage
history
Sample i/p and o/p
1.49 Command 49: groups
Purpose
print the groups a user is in
Usage
groups
Sample i/p and o/p
output.error.png
1.50 Command 50: cut
Purpose
remove sections from each line of files
Usage
cut --characters=3 [filename]
Sample i/p and o/p