BSC OS LAB PROGRAM TO UNDERSTAND BASIC LINUX COMMANDS
pwd command
The pwd command allows you to print the current working directory on your terminal. It’s a very basic command and solves its purpose very well.
adc@2lab-PC-60:~$ pwd
Output: /home/adc
mkdir command
The mkdir command allows you to create directories from within the terminal.
adc@2lab-PC-60:~$ mkdir avrk
adc@2lab-PC-60:~$ cd avrk
adc@2lab-PC-60:~/avrk$
rmdir command
Removes an empty directory.
adc@2lab-PC-60:~$ rmdir avrk
adc@2lab-PC-60:~$
grep command
The grep command stands for “global regular expression print,” which reflects its ability to search for regular expressions across multiple lines and files.
dc@2lab-PC-60:~$ grep "pwd" linux
Output:
pwd command
The pwd command allows you to print the current working directory on your terminal. It’s a very basic command and solves its purpose very well.
chmod and chown commands
The chmod and chown commands are used to modify file permissions and ownership in Linux.The chmod command is used to change the permissions of a file or directory, and the chown command is used to change the ownership of a file or directory.
The default syntax for both the commands is chmod <parameter> filename and chown <user:group> filename
adc@2lab-PC-60:~$ chmod u=rwx,g=rx,o=r linux
adc@2lab-PC-60:~$
ls command
The ls command is used to list files and directories in the current working directory. This is going to be one of the most frequently used Linux commands you must know of.
adc@2lab-PC-60:~$ ls
rm command
The rm command is used to delete files and folders and is one of the important Linux commands you must know.
dc@2lab-PC-60:~$ rm linux
cp and mv commands
The cp and mv commands are equivalent to the copy-paste and cut-paste commands in Windows. But since Linux doesn’t really have a command for renaming files, we also use the mv command to rename files and folders.
adc@2lab-PC-60:~$ cp linux linux2
Comments
Post a Comment