Q. I’m new to Linux and how do I examine filesystem and identify regular files or directories?
A. Both Linux and UNIX comes with ls command for examining the filesystem. You can use ls command to look at the filesystem. ls command can display:
=> Character devices
=> Regular files
=> Sym links (symbolic links)
=> Directories
=> Pipes
=> Sockets
=> Block devices
ls command examples
Display /etc directory files, enter:
$ ls /etc
When invoked without any arguments, ls lists the files in the current working directory:
$ ls
Use -l (long option) to lists filenames, sizes, permissions, type and all other information:
$ ls /etc/passwd
Output:
-rw-r--r-- 1 root root 2453 Jul 17 16:25 /etc/passwd
See Linux / UNIX file permissions for more information
Directory
A directory is marked with a d as the first letter of the permissions field:
ls -ld /etc
Output:
drwxr-xr-x 88 root root 12288 Aug 5 23:46 /etcSymbolic link
A symbolic link is marked with an l (lower case L) as the first letter of the permissions string:
ls -l /bin/nisdomainname
Output:
lrwxrwxrwx 1 root root 8 Jul 10 08:50 /bin/nisdomainname -> hostnameSimilarly,
- A named pipe is marked with a p as the first letter of the permissions string.
- A socket is marked with a s as the first letter of the permissions string.
- A character device is marked with a c as the first letter of the permissions strings. (ls -l /dev/console)
- A block device is marked with a b (ls -l /dev/sdb1).
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop










![Linux Copy File Command [ cp Command Examples ]](http://s13.cyberciti.org/images/shared/rp/3/23.jpg)


{ 0 comments… add one now }