How do we create command aliases in a shell?



How do we create command aliases in a shell?..

Answer / Atul Kumar

In a Linux shell, you can create an alias by using the `alias` command. The basic syntax is as follows:n```nalias <name>=<command>n``` For example, to create an alias named 'ls-a' that functions like the 'ls -a' command (which lists all files, including hidden ones), you would use:n```nalias ls-a='ls -a'n``

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Shell Script Interview Questions

What is the best shell scripting language?

1 Answers  


c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command

1 Answers  


What is the syntax of "grep" command?

4 Answers  


What is computer cli?

1 Answers  


What is the difference between running a script as ./scriptname.sh and sh scriptname.sh

1 Answers  


How would you replace the n character in a file with some xyz?

7 Answers  


What are the disadvantages of shell scripting?

1 Answers  


write a shell script that counts a number of unique word contained in the file and print them in alphabetical order line by line?

6 Answers   IBM, Wipro,


What is a batch file used for?

1 Answers  


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

1 Answers  


What is shell and shell script?

1 Answers  


Write a shell script that adds two numbers if provided as the command line argument and if the two numbers are not entered throws an error message.

1 Answers  


Categories