Linux Commands
-
Change the password (passwd)
-
Print the working directory (pwd)
-
Change directory to the root directory (cd/)
-
List the directory contents in a long format (ls -l)
-
List the directory by time (ls –l -t)
-
List one file that is in each of the subdirectories of root (ls folder |head -1)
-
List the first 20 lines of the file /etc/services (head -20 folder/file)
-
Go back to your home directory (cd/home)
-
Create a new user with your name (su) (useradd username)
-
Assign a password (passwd username)
-
Log out as root and login as your user you created (exit) (su – username)
-
List the files in your home directory using a long listing showing the inode numbers (ls -lai)
-
Get the date and time from the system (date)
-
List all hidden files (ls –l –a)
-
Make a directory (mkdir name)
-
Rename the directory and list again (mv name1 name2)
-
Copy the file for this exercise to a file called filename2, (cp file1 file2)
-
Move up one level in the directory without using any directory names (cd ../)
-
Use three of the who command's variations (who –a) (who –b) (who –H)
-
Add the lines with your name (echo yourname >> /home/username/file)
-
List the file's contents (cat file)
-
Sort the file (sort file1 > file2)
-
Uniq the file (uniq file)
-
Print it (pr file)
-
Find out the inode number of the file (ls -li file).
-
Link the file to a file in your home directory called your name. (ln file1 file2)
-
Change the mode of one file to -rwx------ (chmod)
-
Create a file. (cat > file) (CTRL+D exits)
-
Grep fox from *.text (grep fox *.txt)
-
Find the console file (find /* -name console)
-
Find out which disk drives are mounted on the system and the associated file systems (mount)
-
List the last 15 files in this directory in the long mode. (ls –l | tail -15)
-
Find out the amount of free space on the systems mounted drives (df)
-
Find the group file and print a copy of its contents (groups)
-
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)
-
Find the group file and list its contents (groups) (id –g)
-
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)
-
Find out the last time a user logged on to a Linux system? (last)
-
top command (top)
-
A copy of the current password file (cp /etc/passwd mypasswd)
-
The last five times you logged in (last username)
-
A list of who is logged into the computer (w)
-
The file should contain the syntax to e-mail the file with a specific subject line (mail name@gmail.com Subject: title)
-
Show the execution of its invocation (sh file)
-
Cat a listing of the script (cat file)
-
Download and install GPG on Linux Machine from http://www.gnupg.org/ (cd /folder/gnupg-1.4.11) (make install)
-
VPN to the Frear network and ssh to your host, generate a public/private keypair set (ssh-keygen -t dsa)
-
Encrypt the file (gpg -c file.pgp)
-
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)
-
Decrypt those files (gpg -d file.pgp.gpg)
Windows Commands
-
Change directory to the root directory (cd \)
-
List the directory contents in a long format (dir)
-
List the directory by time (dir/o:-d)
-
Get the date and time from the system (date)
-
Open a DOS window, change directories to root. Make a directory (md name)
-
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")
-
Cat a listing of your script showing the invocation of the cat command (type file.vbs)
(Wscript.Echo "Hello World") (Wscript.Quit 0)
-
Cat a listing of the script’s output file showing the invocation of the cat command (dir file.vbs > file)
-
Generate a public/private keypair set (gpg --gen-key)
-
Create a file (copy con file.pgp)
-
Encrypt the file (gpg -r username -e file.pgp)
-
Create two users to Exchange public keys and files (gpg --export -a "username" > public.key)
-
Decrypt those files (gpg -d file.pgp.gpg)
Go to Top of Page