Latest Posts
- Using the Find Command to Search for Large Files in Linux/Unix
- Finding Files by Date in Linux/Unix: A Comprehensive ‘find’ Command Guide
- Efficient File Search in Linux/Unix: A Guide to Using ‘find’ by Name
- How to Use the ‘find’ Command by File Type in Linux/Unix: A Practical Guide
- Best Practices for Sorting with the Top Command in Linux/Unix
Tags
awk awk -F awk examples background run script bash awk command grep linux curl disk space docker commands docker usage du file search find and grep find command find examples Google Analytics grep -v grep examples java java example linux awk linux command linux find linux grep linux ls ls -al ls examples ls sort ls sort by size mkdir mv examples mysql mysql example rm sed sed examples sed tutorial seo Shell tutorial top vim vim examples vim tutorial w wordpress
Category Archives: File & Directory
cat command tutorial in linux/unix with examples and use cases
linux cat command – concatenate files and print on the standard output. This article shares the syntax, options, and usage examples for the cat command. Continue reading
Posted in File & Directory
Tagged cat, cat examples, linux command
Comments Off on cat command tutorial in linux/unix with examples and use cases
tail command tutorial in linux/unix with examples and use cases
linux tail command – output the last part of files, it corresponds to the linux head command. This article introduces the tail syntax, options, and examples. Continue reading
Posted in File & Directory
Tagged linux command, linux tail command, man tail, tail -f
Comments Off on tail command tutorial in linux/unix with examples and use cases
rename file linux – use rename cmd or mv cmd or awk cmd
Rename file in linux has two ways: linux rename command and linux mv command. linux rename command rename command – renames multiple files. Ubuntu is used as the test system, it does not have the remanae command installed by default. … Continue reading
Posted in File & Directory, Awk Command, Internet Technology
Tagged linux command, mv, rename file linux
2 Comments
ls only files or directories examples in linux
linux ls only directory:
➜ ls -d */ ;
➜ ls -l | grep “^d” ;
➜ find . -type d -maxdepth 1;
linux ls only files:
➜ ls -l | grep “^-” ;
➜ find ./ -type f … Continue reading
Posted in File & Directory
Tagged linux ls, ls dir, ls files
Comments Off on ls only files or directories examples in linux
How to sort by size, type, time, name using linux ls command
Linux ls command can use command options to sort files or directories. This article describes: ls sort by size, ls sort by time, ls sort by name, ls sort by type Continue reading
Posted in File & Directory, How to
Tagged linux ls, ls sort by name, ls sort by size, ls sort by time
Comments Off on How to sort by size, type, time, name using linux ls command
How to split large files by line or by file size in Linux
When Linux splits large files, we usually use the linux split command to split files by line or by size.
When you split the file, also need to use the split of the string. Continue reading
Posted in File & Directory, How to
Tagged linux command, linux split, split file
Comments Off on How to split large files by line or by file size in Linux
grep multiple words/patterns/strings, and/or condition, use -e or regex
grep multiple words
You can use grep -e parameters and pipes (“|”) to implement grep multiple words “and” query, “or” query … Continue reading
Posted in File & Directory
Tagged grep and or, grep examples, linux command
Comments Off on grep multiple words/patterns/strings, and/or condition, use -e or regex
linux grep process by name/by id and kill example, and grep -v example
linux grep process
– grep process name;
– grep process by port;
– grep process id and kill;
– grep process without itself;
– grep process without grep
… Continue reading
Posted in File & Directory
Tagged grep -v, grep awk ps, grep examples, linux command
Comments Off on linux grep process by name/by id and kill example, and grep -v example
How to count using the grep command in Linux/Unix
linux grep count * ; – grep count lines; – grep count words; – grep count files; – grep count sort; – grep two words on the same line …… Continue reading
Posted in File & Directory, How to
Tagged grep count, grep examples, linux command
Comments Off on How to count using the grep command in Linux/Unix
linux grep command – grep not include, grep reverse match
There is also a case where we need to exclude certain content when we do content search. How to achieve it? Still linux grep command! I have such a file test5.txt. Need to query the line containing “dfff” content but … Continue reading
Posted in File & Directory
Tagged grep -v, grep examples, linux command
Comments Off on linux grep command – grep not include, grep reverse match
linux grep command – grep only show match
When we search for content, sometimes we just need to show matching content. At this time we can use the grep command. linux grep You can also display the line number where the matching content is located. linux grep -n … Continue reading
Posted in File & Directory
Tagged grep before and after, grep examples, grep show match, linux command
Comments Off on linux grep command – grep only show match
Linux Location and File Finding Command
linux locate Syntax Explain Linux locate command is used to find eligible documents or directories in the database. When locate is first executed, it establishes an index database, and when it is executed again later, it quickly locates files from … Continue reading
Posted in File & Directory
Tagged linux find, linux locate, whereis, which
Comments Off on Linux Location and File Finding Command
linux grep command – grep multiple patterns
The last article 《grep or condition, grep and condition》 introduced grep and, or use, including the use of the -e parameter. Here is a detailed description of the use of the -e parameter. grep one pattern ➜ grep “12” test1.txt … Continue reading
Posted in File & Directory
Tagged grep -E, grep examples, grep for two strings, linux command
Comments Off on linux grep command – grep multiple patterns
grep show lines before and after
Usually when searching for keywords, we need to look at the keyword context information, all of which use -A, -B and -C parameters. Show num rows after matching – grep -A Show num rows before matching – grep -B Show … Continue reading
Posted in File & Directory
Tagged grep before after, grep examples, linux command
Comments Off on grep show lines before and after
linux grep or , grep and , grep not condition examples
Linux grep conditional;
Grep OR:
1. Use regular, grep -E “[A|B]”;
2. Use -e,grep -e “A” -e “B”;
Grep AND:
Use pipe, grep “A” | grep “B”;
Grep NOT: use grep -v Continue reading
Posted in File & Directory
Tagged grep and, grep or expression, grep or syntax, linux command
Comments Off on linux grep or , grep and , grep not condition examples