Category Archives: File & Directory

In Linux/Unix, a tutorial on using file and directory commands such as ls, mkdir, mv, etc.

How to fast search for specified content in large files in linux

In linux, to search for specified content in large files, we can use tail -c or head -c commands. Continue reading

Posted in File & Directory, Text Processing | Tagged , , , | Comments Off on How to fast search for specified content in large files in linux

How to find all files containing specific text on Linux?

In linux, to find all files containing a specific text, we can use the grep command, which can search for the specified text in the file. In the following example, we will introduce two methods to find all files containing … Continue reading

Posted in Find Command | Tagged , , | Comments Off on How to find all files containing specific text on Linux?

The difference between ls, ls -a, ls -A, ls -l, ls -al, ls -lrt

ls -a : display all files and subdirectories in the current directory, including hidden “.” And “..” etc; ls -l : display detailed information of non-hidden files and directories. Continue reading

Posted in File & Directory | Tagged , , , | Comments Off on The difference between ls, ls -a, ls -A, ls -l, ls -al, ls -lrt

Sort files or folders by date/time with ls command in linux/unix

In linux/unix ls -t option can be sorted by date from newest to oldest, or ls -rt option can be sorted by date from oldest to new. Continue reading

Posted in File & Directory, How to | Tagged , | Comments Off on Sort files or folders by date/time with ls command in linux/unix

How to find and locate php.ini in linux/unix

When we work in PHP development, we often encounter situations where we modify the php.ini configuration file. But many people don’t know how to locate php.ini files in the Linux/MAC production and development environment. How to find and locate php.ini … Continue reading

Posted in Find Command | Tagged | Comments Off on How to find and locate php.ini in linux/unix

mkdir command tutorial in linux/unix with examples and use cases

linux mkdir command – make directories Linux mkdir command is used to create directories. If the directory does not exist, it is created. Syntax Options -m, –mode=MODE set file mode (as in chmod), not a=rwx – umask -p, –parents no … Continue reading

Posted in File & Directory | Tagged , | Comments Off on mkdir command tutorial in linux/unix with examples and use cases

rmdir command tutorial in linux/unix with examples and use cases

linux rmdir command – remove empty directories Linux rmdir command is used to remove directories. If the directory is empty, it is removed. If the rmdir directory is not empty, the error message “Directory not empty”. You need to use … Continue reading

Posted in File & Directory | Tagged , | Comments Off on rmdir command tutorial in linux/unix with examples and use cases

touch command tutorial in linux/unix with examples and use cases

Linux touch command – change file timestamps Linux touch command is used to modify the time attributes of a file or directory, including access time and modification time. If the file does not exist, the system will create a new … Continue reading

Posted in File & Directory | Tagged , | Comments Off on touch command tutorial in linux/unix with examples and use cases

pwd command tutorial in linux/unix with examples and use cases

linux pwd command – print name of current/working directory Linux pwd command is mainly used to print the full filename of the current working directory. Syntax Options -L, –logical use PWD from environment, even if it contains symlinks -P, –physical … Continue reading

Posted in File & Directory | Tagged , | Comments Off on pwd command tutorial in linux/unix with examples and use cases

cd command tutorial in linux/unix with examples and use cases

linux cd command – switch directory Linux cd command is used to switch the current working directory to dirName. Syntax dirName: can be absolute or relative. If the directory name is omitted, it means to switch to the root directory … Continue reading

Posted in File & Directory | Tagged , , | Comments Off on cd command tutorial in linux/unix with examples and use cases

ls command tutorial in linux/unix with examples and use cases

linux ls command – list directory contents Linux ls command is the most commonly used command in our daily use of linux. ls can not only display the name of each file and directory and its associated information, but also … Continue reading

Posted in File & Directory | Tagged , | Comments Off on ls command tutorial in linux/unix with examples and use cases

rm command tutorial in linux/unix with examples and use cases

linux rm command – remove files or directories The linux rm command can remove each specified file. By default, the rm command cannot remove directories. if you need to remove directories, you need to use parameter. Syntax rm [OPTION]… [FILE]… … Continue reading

Posted in File & Directory | Tagged | Comments Off on rm command tutorial in linux/unix with examples and use cases

Linux common commands tutorial and use examples

Linux Commands Tutorial
1. Linux common directory command list
2. Linux file operations commands
3. Linux file permissions commands
4. Linux file content view commands
5. Linux text processing commands
Continue reading

Posted in File & Directory, Monitor, System, Text Processing | Tagged , , | 1 Comment

How to change permissions folder and all its subfolders and files in linux

Changing the permissions of a folder and its subfolders and files is often used in Linux operations.For example: To change all the directories and files to 755 Continue reading

Posted in File & Directory, How to | Tagged , , | Comments Off on How to change permissions folder and all its subfolders and files in linux

grep command tutorial in linux/unix with examples and use cases

linux grep command – print lines that match patterns Linux grep searches for PATTERNS in each FILE. PATTERNS is one or patterns separated by newline characters, and grep prints each line that matches a pattern. A FILE of “-” stands … Continue reading

Posted in File & Directory | Tagged , , | Comments Off on grep command tutorial in linux/unix with examples and use cases