$ info
$ which ls
output: /usr/bin/ls
$ link fileExist.txt newLinkFile.txt
- The file name and the file's data are two separate entities.
$ ls -li
$ find / -inum 531188
$ find . -type f -links +1 2>/dev/null
$ls -p | grep -v /
\
$ls -p | grep -v / | column
Using ls -p tells ls to append a slash to entries which are a directory, and using grep -v / tells grep to return only lines not containing a slash.
- p adds the forward slash ('/') to the directory names
- r reverses the order of output
- v lets grep do an inverse search to print everything except the directories (everything that doesn't have the '/' that -p put there)
- column puts it in columns
find . -maxdepth 1 -not -type d
ls -p | egrep -v /$
ls -F | grep -v /
Above command displays files, But it includes symlinks, pipes, etc. If you want to eliminate them too, you can use one of the flags mentioned below.
ls -F appends symbols to filenames. These symbols show useful information about files.
- @ means symbolic link (or that the file has extended attributes).
- * means executable.
- = means socket.
- | means named pipe.
- > means door.
- / means directory.
ls -F | grep -Ev '/|@|*|=|\|'
ls -F | grep -Ev '/|@|*|=|>|\|'
$ whatis dpkg
$ which column
$ dpkg -S $(which column)
$ ip address
- Files: rw-rw-rw- (666)
- Directories: rwxrwxrwx (777)
$ umask
Lets assume your umask value is 002
octal to binary to mode
002 --> 010 --> -w-
Now create a file called: student.txt
Calculate the mode value beforehand:
rw- rw- rw-
--- --- -w-
----------------
rw- rw- r-- ==> 664
Now check the student.txt file permssion using ls -l or stat command
$ stat student.txt