The ls, du, and sort Commands, How to Get the LILO Prompt Back
The ls command allows file listings to be displayed in a variety of ways. Commonly used options are -a (does not hide dot.files), -l (long/verbose listing format, includes file attributes and sizes), and -color (displays files/directories in different colors depending on attributes). Type man ls to get a more complete listing of options.
How can I change the way files are displayed by default in a directory listing?
The ls command allows file listings to be displayed in a variety of ways. Commonly used options are -a (does not hide dot.files), -l (long/verbose listing format, includes file attributes and sizes), and -color (displays files/directories in different colors depending on attributes). Type man ls to get a more complete listing of options.
One of the easiest ways that you can set default attributes for ls is to set up a shell alias. I’ll use bash for the example here. Try adding the following line to the file .bashrc in your home directory.
alias ls = ls -a -color
You can also type this command in the current shell to make the alias effective immediately (until you close your shell).
The lines in the .bashrc file are run every time you begin an interactive shell, ensuring that this alias is reset automatically.
I have a Perl script that will not run. Executing it results in a bash: ./script.pl: No such file or directory error. The file exists and is executable. Why won’t it work?
Executable scripts may use the first line of the script to tell the shell which pro-gram to run in order…
Please log in to view this content.
Not Yet a Member?
Register with LinuxMagazine.com and get free access to the entire archive, including: