Here goes another tutorial that would uncover samples of using the most commonly used linux command using the command line terminal.
This linux blog entry covers the tutorial of using one of the simplest command line in linux terminal.
LS Tutorial - Display Files and Folders in Linux
ls is a linux command that is basically being used from command line terminal to list down directory contents. Directory contents can are linux files, it can be typical directory files, special files, directories, hard and soft links or any other device contents.
File items and directory folders are usually the contents of current working folder. Linux directory usually contains folder locations the probably contains zero or more files inside it, while linux files are files, hard or soft links to files or device that contains zero or more data contents when viewed or referenced from.
Here are more ls samples that might be helpful on learning this ls command.
How to list down all files and directory folders of current working directory.# ls
How to list down all files and directories using ls a short format form
# ls -a
How to list down all files and directories using ls a short format form# ls -la
Using the above two commands shows linux files and folders. In a long format, ls shows directory contents with their corresponding file attributes and file ownership and permissions, date/time stamps and filesize .
Most linux distro uses command aliases.
To print the current alias for ls, simply# alias ls
Using the above command would show the current ls alias and ls parameters when issued directly from the command line. This goes to any other linux command aliases.
To continue with ls command, here's how to list down all directory contents excluding . and .. in a short ls form# ls -A
Combining the previous two commands of using ls to show the long format form and all directory contents but without . and ..# ls -Ala
To list down directory contents in a more human readable form showing sizes like 1K, 2M 3G file sizes# ls -h
# ls -hal
# ls -halA
To list down directory contents without showing ownership and group names would be done respectively like so# ls -aG
# ls -aGg
To list down directories and folders only in ls short form# ls -d */
To list down directories and folders only in ls long form would be# ls -dl */
To list down directories and folders start starts with d displayed in ls short form would be# ls -d d*/
To list down directories and folders start starts with d displayed in ls long form would be# ls -dl d*/
ls always shows directory contents in a colored ls alias fashion. To ignore and display directory contents without screen colors would be
# ls -la --color=never
To list down directory contents with reverse matching pattern and hide a specified patterns from being displayed would be# ls --hide=v*
# ls --ignore=v*
The above list down all directory contents except the ones that starts with the letter v
To list down directory contents with numeric user and group IDs using ls would be# ls -n
To list down directory contents with index number of each item would be# ls -lai
To list down directory contents showing also the link reference rather than the link itself would be# cd /dev
# ls -laL
To list down directory contents recursively would be# ls -R
To list down directory contents sorted by modification time would be
# ls -t
# ls -lat
The default ls tab stop is 8, if you want to customize the ls tab stop, simply specify it like so# ls --tabsize=16
To list down directory contents separated by comma in a short ls form would be# ls -m
To reverse the sort ordering display of directory contents using ls would be
# ls -r
# ls -lar
HTH
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2007
(340)
-
▼
September
(58)
- Dear Linux SysAd Blog Readers
- Proactive monitoring from linux terminal
- deleting new lines and return line from text file
- Google chat setup using PSI howto
- PSI messenger - a truly promising open messaging a...
- Google chat setup using GAIM Pidgin howto
- Linux command line shell variables defined
- ls - displaying directory contents in many ways
- Control of alternative linux executables
- Searching using whereis linux command
- Witchy which linux command
- NeroLinux - diehard Nero burning software
- Google Sky - Explore and Rediscover the Sky
- Celestia - 3D Earth and Sky visualization
- Earth3D - real-time 3D Earth visualization
- GcStar - managing personal collection items
- DStat - resource statistics linux tool
- Bandwidth Monitor-NG - terminal-based interface ba...
- KNemo - KDE network interface monitoring tool
- EtherApe - graphical network activity monitoring tool
- Beauty of Math using Linux
- print leading/trailing lines before/after a matchi...
- Nagios Monitoring - install and generic setup howto
- ChRT- change real-time attribute process scheduling
- squeezed out multiple commented lines
- UNIX to DOS text file format converter
- totally squeezed out multiple blank lines
- squeezed multiple blank lines into single line
- fmt - simple optimal text formatter
- Linux backup powered by RDiff-Backup
- Linux Ping command explained
- read and display text file from terminal
- URLView - URL and email extractor
- TFTP server - setup and install howto
- NMap - Linux port scanning
- removing garbage characters from screen terminal
- invert string match using grep
- RDesktop - remote desktop howto
- Graveman on Linux - burn baby burn burn
- HTOP - interactive process viewer alternative
- Caching DNS server install howto
- BitTorrent - downloading large files made easy
- PHPAlbum - web photo album install howto
- MRTG graph creation with Cisco routers
- Tree view of directories and file listings from co...
- MAC address packet filtering using IPTables
- GTK-based GNOME Linux Tools
- Linux backups powered by RSnapShot
- MRTG tutorial, install and howtos
- FindSMB - view shared folders from network
- Squid - upgrade and install howto
- prompt and press a key between script lines
- Devede - DVD/VCD video authoring and creation tool
- display file and file system status
- determine file type
- GNOME GUI task scheduler install howto
- Linux backups powered by Rsync
- KPackage - GUI package administration and manageme...
-
▼
September
(58)
Friday, September 21, 2007
ls - displaying directory contents in many ways
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment