Sara Mithal
This user hasn't shared any biographical information
Posts by Sara Mithal
How to generate or print a sequence of numbers in bash
Jan 11th
The command “seq” can be used to generate a sequence of numbers in bash. The following is the syntax of “seq” command.
seq LAST seq FIRST LAST seq FIRST INCREMENT LAST
Look at the following to understand how it works.
Example 1:
[sara@sara-desktop ~]$ seq 5 1 2 3 4 5 [sara@sara-desktop ~]$
Example 2:
[sara@sara-desktop ~]$ seq 5 10 5 6 7 8 9 10 [sara@sara-desktop ~]$
Example 3:
[sara@sara-desktop ~]$ seq 0 10 50 0 10 20 30 40 50 [sara@sara-desktop ~]$
Generally the “seq” command prints one number per line as it assumes “\n” as the separator. However the character used as More >
How to delete a file whose name starts with minus character
Dec 21st
Sometimes an untended paste operation of screen dump results in unwanted files. If a file name starts with a minus (-) character, it is not possible to delete the file using traditional command as anything that starts with a minus (-) character is treated as one of the command line options.
For example, look at the following file “-myfile.txt“.
[sara@techpulp ~]# ls -myfile.txt [sara@techpulp ~]#
Traditional way fails to remove the file.
[sara@techpulp ~]# rm -myfile.txt rm: invalid option -- 'm' Try `rm --help' for more information. [sara@techpulp ~]#
You can use “–” option to stop “rm” command to stop expecting further command More >
How to execute a command with in VI
Feb 28th
You can use “:!” sequence followed by the command string in the command mode of VI.The following steps explain the procedure.
Type Esc to enter in to VI command mode
Type colon (:) and (!) followed by actual command string.
For example, if you want to run “ls” command, you would need to type “:!ls” in VI.


Recent Comments