Sara Mithal

This user hasn't shared any biographical information


Posts by Sara Mithal

How to delete a file whose name starts with minus character

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

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.