Linux – chmod

Linux chmod command Linux chmod command is used to change access permissions of files and directories. In this article, you will learn how to change permissions of any file or directory with chmod command. We have already described the Linux file permissions. Syntax: chmod [PERMISSIONS] [FILE]… Example: chmod 755 filename You can use -R to change permissions recursively. chmod -R 755 /var/www/html There are two ways available to change file permissions on Linux. First is Symbolic Notation and second is octal notation. Both are described below: Using Symbolic Notation: Just…

Read More

Linux – wc

Linux wc command The Linux wc command is used to count the number of lines, words, and byte (character) in a file or input stream. Syntax: wc [OPITON] [FILE} Example: Use -l to count the number of lines in a file wc -l myfile.txt Use -w to count the number of words in a file wc -w myfile.txt Use -c to count the number of bytes in a file. You can use this to count character in a file wc -c myfile.txt Use wc with Piped Input You can also…

Read More

Linux – cut

Linux cut command The Linux cut command is a text processing command. This command is used to extract the specific column from a file. You need to define the column number and column delimiter with command. Syntax: cut -d<delemeter> -f<field1,field2,…> filename -d This defines the deleter as coloumn seprator. Defaut column seprater is single space or tab. -f Specify fields (column numbers) to fetch. Example Grep all usernames with there home directory created on a Linux system. The /etc/passwd file contained all users on a Linux system with other details.…

Read More

Linux – ls command

Linux ls command The ls command is used to list files and directories in filesystem. Login to your Linux system and open shell. Syntax ls [OPTION] [FILE] Examples Now type ls and press enter. This will show file names available in the current directory. ls Long Listing Files You can use -l switch to view the long listing of files. ls -l You can also specify the filename to get details for a specific file. ls -l myfile.txt List Hidden Files You can also use the -a switch with ls…

Read More