Basic Linux Command - Exercise
Instructions: write command sequence
Step 1: Basic commands and Listing Files
- Open the terminal.
- Check your current directory.(home directory)
- List all files
- Long list the files
- Clear the screen
- Display date and time
- Display the login name
- Display the os details
- Exit from the terminal
Step 2: Creating and Removing Directories
- Open the terminal.
- Check your current directory.
- List all files
- Create a folder ITWORKSHOP
- Change directory to ITWORKSHOP
- Create two folders CSA and CSB
- list the files
- Move to CSB
- Create an empty file
- Move to the parent directory(ITWORKSHOP)
- Use tree command to view the tree structure
- Remove the directories CSA and CSB ( note that you cannot remove non empty directory)
- Create a directory CSC
- Move to your home directory
- Recursively remove ITWORKSHOP and all its subdirectories.
- Exit from the terminal
Step 3: Creating, Viewing, and Removing Files
- Open the terminal.
- Check your current directory.
- List all files
- Create a folder ITWORKSHOP
- Move to the folder ITWORKSHOP
- Create an empty file f1
- Create a file f2 with content "welcome to mec itworkshop"
- Append "hello mec" to f1
- Display the directory contents
- Display the file contents f1 and f2
- long list the files and check the permission, file size etc
- Remove f2
- Move to home directory
- Remove ITWORKSHOP and all its contents
- Exit from the terminal
Step 4: Copying and Moving Files
- Open the terminal.
- Check your current directory.
- List all files
- Create two directories APPLE and ORANGE
- Create a file f1 with content "an apple a day keeps the doctor away"
- Copy the file f1 to directory APPLE
- Change directory to APPLE
- List the files in the directory
- Rename the file f1 to a1
- Copy the file a1 to directory ORANGE
- Change the directory to ORANGE
- List the files in the folder
- Copy the file a1 to a2
- List the files in the folder
- Merge the file a1 and a2 and create a new file o1
- Remove a1 and a2
- Move o1 to home directory
- List the files
- Display the content of o1
- Remove o1
- Remove the folders APPLE and ORANGE
- Exit from the terminal
Step 5: Changing Permissions
- Open the terminal.
- Check your current directory.
- List all files
- Create a file f1 with content "hello mec"
- Long list the details of file f1
- Display the file f1 contents
- Create a link to this file with name f2
- Change the content of f2 by appending "cochin" to f2
- Display the content of f1 and f2
- Check the file details of f1 and f2
- Set the execute permission for owner for file f1
- Set only execute permission for group and others for f2
- Check the permissions using long listing
- Give only read permission for others and group and give all permission for owners for both the files
- Check the permissions by long listing f1 and f2
- Remove f1 and f2
- Exit from the terminal
Comments
Post a Comment