Linux Commands

  1. Change the password (passwd)
  2. Print the working directory (pwd)
  3. Change directory to the root directory (cd/)
  4. List the directory contents in a long format (ls -l)
  5. List the directory by time (ls –l -t)
  6. List one file that is in each of the subdirectories of root (ls folder |head -1)
  7. List the first 20 lines of the file /etc/services (head -20 folder/file)
  8. Go back to your home directory (cd/home)
  9. Create a new user with your name (su) (useradd username)
  10. Assign a password (passwd username)
  11. Log out as root and login as your user you created (exit) (su – username)
  12. List the files in your home directory using a long listing showing the inode numbers (ls -lai)
  13. Get the date and time from the system (date)
  14. List all hidden files (ls –l –a)
  15. Make a directory (mkdir name)
  16. Rename the directory and list again (mv name1 name2)
  17. Copy the file for this exercise to a file called filename2, (cp file1 file2)
  18. Move up one level in the directory without using any directory names (cd ../)
  19. Use three of the who command's variations (who –a) (who –b) (who –H)
  20. Add the lines with your name (echo yourname >> /home/username/file)
  21. List the file's contents (cat file)
  22. Sort the file (sort file1 > file2)
  23. Uniq the file (uniq file)
  24. Print it (pr file)
  25. Find out the inode number of the file (ls -li file).
  26. Link the file to a file in your home directory called your name. (ln file1 file2)
  27. Change the mode of one file to -rwx------ (chmod)
  28. Create a file. (cat > file) (CTRL+D exits)
  29. Grep fox from *.text (grep fox *.txt)
  30. Find the console file (find /* -name console)
  31. Find out which disk drives are mounted on the system and the associated file systems (mount)
  32. List the last 15 files in this directory in the long mode. (ls –l | tail -15)
  33. Find out the amount of free space on the systems mounted drives (df)
  34. Find the group file and print a copy of its contents (groups)
  35. Copy three files from anywhere on the system to your home directory (cp /folder/files/* .) Tar your home directory and call the file yourname.tar (tar -cvwf file1.tar file1.doc)
  36. Find the group file and list its contents (groups) (id –g)
  37. Write a command line sequence that will tell the number of directory entries in a particular directory including hidden files. Provide a listing of its execution and its output (ls -l /sbin|wc –l)
  38. Find out the last time a user logged on to a Linux system? (last)
  39. top command (top)
  40. A copy of the current password file (cp /etc/passwd mypasswd)
  41. The last five times you logged in (last username)
  42. A list of who is logged into the computer (w)
  43. The file should contain the syntax to e-mail the file with a specific subject line (mail name@gmail.com Subject: title)
  44. Show the execution of its invocation (sh file)
  45. Cat a listing of the script (cat file)
  46. Download and install GPG on Linux Machine from http://www.gnupg.org/ (cd /folder/gnupg-1.4.11) (make install)
  47. VPN to the Frear network and ssh to your host, generate a public/private keypair set (ssh-keygen -t dsa)
  48. Encrypt the file (gpg -c file.pgp)
  49. Exchange public keys and encrypted files between your two users and add their key to the other’s key ring (scp ~/ .ssh/id_dsa.pub user@username:.ssh/authorized_keys)
  50. Decrypt those files (gpg -d file.pgp.gpg)

Windows Commands

  1. Change directory to the root directory (cd \)
  2. List the directory contents in a long format (dir)
  3. List the directory by time (dir/o:-d)
  4. Get the date and time from the system (date)
  5. Open a DOS window, change directories to root. Make a directory (md name)
  6. Use the systeminfo command to find out the last boot up time for the system and only the last boot up time information (systeminfo | find "System Boot Time")
  7. Cat a listing of your script showing the invocation of the cat command (type file.vbs) (Wscript.Echo "Hello World") (Wscript.Quit 0)
  8. Cat a listing of the script’s output file showing the invocation of the cat command (dir file.vbs > file)
  9. Generate a public/private keypair set (gpg --gen-key)
  10. Create a file (copy con file.pgp)
  11. Encrypt the file (gpg -r username -e file.pgp)
  12. Create two users to Exchange public keys and files (gpg --export -a "username" > public.key)
  13. Decrypt those files (gpg -d file.pgp.gpg)

Go to Top of Page