Practical: 03
Title: Hands on Unix / Linux command
1. Is:
The ls command is commonly used to identify the files and directories in the working directory. This command is one of the many often-used Linux commands that you should know.
$ls
Output:
2. pwd :
The pwd command is mostly used to print the current working directory on your terminal. It is also one of the most commonly used commands.
$pwd
Output:
3. mkdir :
This mkdir command allows you to create fresh directories in the terminal itself. The default syntax is mkdir <directory name> and the new directory will be created.
$mkdir mgmu
Output:
4. cd:
The cd command is used to navigate between directories. It requires either the full path or the directory name, depending on your current working directory. If you run this command without any options, it will take you to your home folder. Keep in mind that it can only be executed by users with sudo privileges.
$pwd
$cd <directory name>
$pwd
Output:
5. rmdir:
The rmdir command is used to delete permanently an empty directory. To perform this command the user running this command must be having sudo privileges in the parent directory.
$ls
$rmdir <directory name>
$ls
Output:
6. cp:
The cp command of Linux is equivalent to copy-paste and cut-paste in Windows.
$cp Src_file Dest_file
$gedit a.txt ( Insert some text in file and save)
$gedit b.txt (Leave bank and same file)
$cat a.txt (see content of a.txt)
$cat b.txt (no content in b.txt)
$cp a.txt b.txt (copy of a.txt to b.txt)
$cat a.txt (see content of a.txt)
$cat b.txt (see content of b.txt)
Output:
No comments:
Post a Comment