The word count (wc) command is used to count the number of lines, words, and characters in a text file. If multiple files are specified, then the command displays the counts for each file and the total count for all files. Syntax The syntax of the wc command is: # wc [options] {file names} wc […]
Archives for October 2022
printf Command Examples in Linux
The printf command is similar to echo but provides the user with much more control over how the output is formatted. You can supply various format characters within the text you want to output, using a backslash (\) to indicate when they are being used. For example: # printf “Hello.\nWhat’s your name?” will print: Hello. […]
printf: command not found
The printf command is similar to echo, but provides the user with much more control over how the output is formatted. You can supply various format characters within the text you want to output, using a backslash (\) to indicate when they are being used. For example: # printf “Hello.\nWhat’s your name?” will print: Hello. […]
echo: command not found
The echo command is used to display a line of text on the terminal. You can also use the echo command to write text to a file by providing the string after the echo command and redirecting to the file. Synatx # echo [Options] [String] The items in square brackets are optional. A string can […]
unlink: command not found
The unlink command is similar to the rm command, but can only remove one file at a time and cannot remove directories. Syntax The syntax of the unlink command is as follows: $ unlink filename $ unlink option Options unlink command only has 2 optiosn as follows: –help: Print help information and exit. –version: Print […]
rm: command not found
The rm command removes files and directories. You must use the -R option to recursively remove files, subdirectories, and the parent directory itself. To remove a file, you must have write permission in the directory that contains the file, but you need not have permission on the file itself. If you do not have write […]
touch Command Examples in Linux
The touch command changes the time of access or modification time of a file to the current time, or to the time specified in an argument. It is also used to create an empty file with the specified file name, assuming the file does not exist. This is often useful in testing permissions or in […]
touch: command not found
The touch command changes the time of access or modification time of a file to the current time, or to the time specified in an argument. It is also used to create an empty file with the specified file name, assuming the file does not exist. This is often useful in testing permissions or in […]
mv: command not found
The mv command moves files and directories to other locations. It is similar to the cp command but does not leave the initial object in place. Therefore, mv is more like a cut and paste operation. The Bash shell does not have a dedicated rename command but instead uses mv to accomplish that function. The […]
cp: command not found
The cp command enables you to copy and then paste a file or directory. The initial object is left where it is, but an exact duplicate of that object is created at the destination you specify. When you copy directories, you must specify the -R option to copy the specified directory recursively. Syntax The syntax […]