How to show the currently logged in user in linux/unix
Show the current logged-in users is a must in linux/unix, which can help us determine which users are using the terminal window to log in...
How to use awk concatenate string in linux/unix
Awk concatenated strings, you can use awk OFS variables, or you can use strings directly. syntax: awk'BEING {s1="string1";s2="string2";OFS="delimiter";print s1,s2;}'...
How to use awk to select substring in linux/unix
Awk substr has built-in functions that can help us select substrings anywhere in the input string. awk substr syntax: substr(string, start, lenght)...
How to find file by name in linux/unix
To find files by name, we can use the linux find command. For example: find directory -type f -name "filename"...
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...
How does grep exclude directory, file, keyword in Linux/unix
Grep command supports multiple exclusion methods, including grep exclude directory, grep exclude file, grep exclude binary files, and grep exclude keywords....
How to grep ignore case in linux/unix
In linux/unix, we can use the grep -i option to ignore case matching search keywords. grep ignore case syntax: grep -i "keyword" file...
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...
How to find and replace specified string with sed in linux/unix
find and replace content in linux: Use the grep command and sed command to search and replace, Use the find command and sed command to...
How to remove lines with specific line number from text file with awk or sed in Linux/unix
Remove specific line numbers in linux/unix, use awk NR variable to delete a specific line numbers, use sed command action option "d" to delete a...
sed tutorial: sed address and address range(select lines) with examples
sed address and address range tutorial, by using addresses or address ranges, the sed command can apply certain actions to these address lines....
How to use sed to replace multiple patterns at once in linux/unix?
sed is a powerful streaming text editor, and replace pattern is one of the most used functions. This article introduces how to replace multiple patterns...
How to remove the first line of a text file using the linux command line?
remove the first line: use awk NR variable, awk '{if(NR>1){print $0}}' file ; use sed action option d, sed '1d' file; use tail n...
How to delete empty lines in a text file in linux/unix
To delete blank lines in a text file, you can use awk NF variable, awk regular expression, sed regular expression and grep -v '^$'...
How to delete lines containing a specific string in a text file in linux/unix
Delete lines containing a specific string in a text file, we have three implementation methods: sed -i '/ pattern/d', grep -v 'pattern' and awk '!/pattern/...