Posts

String variable type in programming

Image
String variable type in programming is a collection of characters. Strings in programming are enclosed in single or double quotes. A person who creates a string object needs to be consistent with opening and closing quotes. If a single quote is used for start of a string, then single quote needs to indicate where it ends. YouTube video

Formatting variable names

Image
Sticking to a specific format of naming the variables will make code looks nice. It will also remove confusion from a developer of how to format a variable. Common variable naming formats are: Upper case characters and underscores separating words. Even so this one of the variable naming formats, it is a good practice of using upper case letters for constants. Pascal case. First letter of each word is capitalized. Camel case. First letter of first word is lower case, all of the following first letters of each word are capitalized. Camel case is also known as mixed case. Capitalized with underscores. Each word in a variable name is separated by the underscore character.

Copying a file in Linux

​Copying a file in Linux is done using ‘cp’ command. Command ‘cp’ is short for word copy. There are a number of command switches for ‘cp’ command. One of the useful switches is -r of -R. Both lowercase and uppercase options are supported. Long form of it will be --recursive. It will copy recursively files and folders.

Creating an empty directory in Linux

​An empty directory in Linux can be created with mkdir command. This command will be followed by the name of the directory. The directory can be just a one word name, in this case a directory will be created in the current path. The directory name can be also a full path. Last directory in the path name will be created. If path doesn’t exist than such a directory will not be created, it is necessary to specify -p flag, it stands for word parent. If such flag is specified, then all of the directories in the path will be created.

Creating an empty file in Linux

​An empty file in Linux can be created with ‘touch’ command.

Creating files in Linux using cat command

​There are a number of ways to a new file in Linux. One of the ways is to use cat command and redirect output to a new file. Command ‘cat’ is short for word concatenate.

Listing processes in Linux using ps command

​ps command in Linux will list running processes. There are a number of switches that can be used with this command. Please refer to that command documentation to list all of the possible switches. Often this command will be paired with ‘grep’ command to filter only those processes that are needed.