Open Ubuntu by simply searching 'Ubuntu' in your Windows search bar and clicking on the Ubuntu app. Once opened, you'll have access to the terminal where you can enter your commands.
In Ubuntu and many other Linux-based operating systems, the "Home folder" or "home directory" is a central location on your system where each user has their own dedicated storage space for personal files, documents, configuration files, and settings.
You can access your home directory using the "~" (tilde) notation.
- The "cd" command, short for "change directory," is a fundamental tool in command-line interfaces like the Linux terminal and Windows Command Prompt.
- Its primary function is to facilitate seamless navigation between directories or folders within a file system.
- The cd command allows you to change your current working directory to a specified directory.
- You always need to pay attention to your working directory.
- You can use the cd command followed by the path to the directory you want to navigate to (get into).
cd /path/to/directory
- You can use cd without any arguments to quickly return to your home directory.
cd
For in-class tasks, you are required to execute the commands as instructed and capture the command history upon completion. To ensure that only the commands executed during the current session are captured, it’s recommended to start each session with a clean history. Use the following command to clear the command history stored in the current session.
# Clear the current session's history
history -c- When your directories or files are located within the same directory, you can use relative pathstree to efficiently navigate up or down the directory tree from your current location.
cd ..moves up one level back (towards the parent directory).cd foldernamemoves into a directory named "foldername" in your current location.
You can also use the tilde (~) as a shortcut to represent your home directory.
cd ~Learn to navigate between directories using the absolute path.
You task is to create a couple of directories in your home folder.
Your task is to create multiple directories at least 3 with a single mkdir command.
Your task is to create 3 text files using a text editor. You can write something in your text file. You can create these text files into any of the directory that you have created above. Remember how to save the file using nano.
What do you understand by absolute and relative path? Discuss with each other with examples.
Learn to use pipe sign as mentioned in the video tutorial.
Use some wild characters with ls commands and get familiar with wildcard characters.
Your task is remove one of the empty director which you have created above.
Your task is remove the directory that has files which you have created above with nano text editor.
Create 3 text files in one of your directory and copy them to different directory.
Create 3 text files in one of your directory and move them to different directory.
Rename a few of your files and directories.
-
Create a text file called data.txt using nano text editor. Copy some text from wikipedia ( atleast a couple of pages).
-
Use cat command to view the file's content.
-
Use less command to display one page at a time.
-
Use spacebar to go to the new page.
-
Type q to quit viewing the file.
-
-
Use head command to view the head of the file.
-
Use tail command to view into the end of the file.
-
Use grep command to search something within your file
Learn to use pipe sign as mentioned in the video tutorial.
Discuss what is a root user ?
Hidden Files
How can you hide a file in Ubuntu?
After you have done all the above tasks, you will run the following commands (one by one) and create firstname_lastname_T1.txt file in your home directory.
history >firstname_lastname_T1.txt
echo "User: $(whoami), Date and Time: $(date)" >> firstname_lastname_T1.txtType explorer.exe . in your terminal and you will see the file firstname_lastname_T1.txt
Now drag that file to your repository for third portfolio.
Note: Always, check the contet of the file created to verify it includes every commands that you have executed.
done as required