- Alias is a shortcut to reference a command.
- It can be used to avoid typing long commands that are frequently used.
- For common patterns it can reduce keystrokes and improve efficiency.
A user want to delete a file with confirm delete option for that we type
rm -i file.txt
remove file.txt? y
But some time we forgot to write -i , to avoid this such issue we use alias.
| Command | Desc |
|---|---|
| Syntax Of alias | alias [-p] [name="value"] |
| Example: | |
| alias | It will show you list of alish which is present in system |
| alias ls="ls -al" | lists the names of the files and directories within the current directory |
| alias df="df -h" | size, amount of space used, amount of space available (-h) in MB and GB |
| alias rm="rm -i" | increasing the safety of the system by making commands interactive. It is use for remove files |
| alias cp="cp -i" | increasing the safety of the system by making commands interactive .It is use for copy files |
| Removing Aliases | |
| Syntax | unalias [-a] name(s) |
| Example: | unalias rm |
No comments:
Post a Comment