Printing files content in output cat command The “cat” command stands for concatenate. It is one of the most useful commands in Linux. This command displays file content in the output concatenates and creates files. Syntax cat [OPTION] [FILE]………… Example Cat without any options displays the file’s content in the output. If sending multiple files […]
Loops Loops are very useful for automating repetitive tasks. when you want to run a series of commands repeatedly until a certain condition is reached. Type of loops: Simple For loop Range-based for loop C-Styled for loops Infinite for loop Simple For Loop: for var in word1 word2 … wordN do Statement(s) to be executed […]
Removing files or directories “rm” stands for remove, so as Its name shows, this command deletes files, directories, and even symbolic links- which we will cover in later lessons-. “rm” command works silently, so users must be careful using it because this command deletes files permanently and users can not restore them after deleting. Although […]
mv Command To move files or directories from a source to a destination in Linux, use the “mv” command. This command has got two functions. First, moving files or directories, and second, renaming a file or directory. It can also move multiple files or directories. “mv” command, as we explained in the “cp” command, works […]
mkdir Command In Linux, users use the “mkdir” command to create new directories. So because creating a directory is a “write” action on the parent directory, users should have the write permission on the parent directory. Users also can create multiple directories or nested directories. Syntax mkdir [option] dir-name Examples: mkdir without any options and […]
Filename As we mentioned before, In Linux, everything is a file. So every file must have a filename. A Filename in Linux is a path to the file that contains the directory name and basename. The directory name is the directory path to the file’s parent directory. The basename is the exact name of the […]
We talked about directory content list commands in the previous post and introduced the “ls” command. We will continue the last lesson here, But before that, we have to get to know special characters and their usages. Special characters In Linux, a group of characters have special meaning and act in two different ways in […]
In this lesson, we will talk about the path in Linux, which is one of the essential concepts in Linux administration. What is a Path? Every file and directory has a unique location in the Linux file system structure. To access files and directories or to call them in a command or script, Administrators need […]
Array Array is a data structure consist multiple elements based on key pair basis and the element is accessible via a key index number. Unlike most of the programming languages, Bash array elements don’t have to be of the same data type. You can create an array that contains both strings and numbers. How to […]
Variables A symbolic name for a chunk of memory to which we can assign values, read and manipulate its contents. A variable in bash can contain a number, a character, a string of characters. Variable in Bash dose not have data types. You have no need to declare a variable, just assigning a value to […]