Commands with example
1. Man: provides offline documentation for all possible option with a command and its usage.
# man cp
2. Mv: is used to move or rename files.
# mv [filename] [new_filename] Rename
# mv [filename] [des_dir] Move
# mv file1.txt backup.txt
# mv backup.txt /home/geeko/downloads
3. Less: allows quickly view file. You can page up and down. Press “ q ” to quit from less windows.
# less install.log
# less -N /etc/passwd
4. Tail: display the last part of file.
# tail –n 100 /var/log/httpd/error_log
5. Useradd: is used for adding/creating user accounts in Linux and other Unix-like system.
# useradd [option] username
# useradd –m geeko (create new user with home directory)
# passwd geeko (assign password to new user)
6. Cut: for cutting out the sections from each line of files and writing the result to standard output.
# cut /etc/passwd -d “:” -f 1 (Display only first filed of the /etc/passwd)
7. Scp: is used to copy file(s) between servers in secure way.
# Scp [src_file_name] [username@des_host:des_folder]
# scp –pv lab.pdf geeko@10.10.0.2:/home/geeko (copy a file to remote host)
# scp –r /mnt/data root@10.10.0.2:/opt/backup (copy all files within /mnt/data folder to remote host)