the diary for one command application of pipe in Linux
2017-04-15 21:46
555 查看
ls -l /projects/ghosttrail | tail -n +2 | sed 's/\s\s*/ /g' | cut -d ' ' -f 3 | sort | uniq -c
actually in my first glance, i think it is complicated, and the true is that i got stopped when i see the third code of the program sed,i have forget waht is the \s meaning,when i figure it out and run each program separately,
i understand this sentence.
the first part "ls -l ......" is to list the detailed files information within the specified directory;
the second part "tail -n +2" is to filter the result given from first part command to get result without total number of files;
the third part "sed 's/\s\s*/ /g" is to substitute white spaces with only one space';
the fourth part "cut -d ' ' -f 3" is to get the third filed data;
the fifth part " sort " is to sort result alphabetically;
the final part "uniq -c" is to add the repetition number of every line result;
Learning is cool!
actually in my first glance, i think it is complicated, and the true is that i got stopped when i see the third code of the program sed,i have forget waht is the \s meaning,when i figure it out and run each program separately,
i understand this sentence.
the first part "ls -l ......" is to list the detailed files information within the specified directory;
the second part "tail -n +2" is to filter the result given from first part command to get result without total number of files;
the third part "sed 's/\s\s*/ /g" is to substitute white spaces with only one space';
the fourth part "cut -d ' ' -f 3" is to get the third filed data;
the fifth part " sort " is to sort result alphabetically;
the final part "uniq -c" is to add the repetition number of every line result;
Learning is cool!
相关文章推荐
- the diary of sleep jobs & fg command line in linux
- the diary of how to backup one more files in linux
- the diary of pipe in linux
- 22.You need to create a table for a banking application. One of the columns in the table has the fol
- Getting over the dangers of rm command in Linux---reference
- the diary of homework of script check dir in linux
- An A-Z Index of the Bash command line for Linux.摘自https://ss64.com
- The Application of Two-level Attention Models in CNN for Fine-grained Image Classification
- the diary for redirection in linux
- Getting over the dangers of rm command in Linux---reference
- Burp Suite is one of the best tools available for web application testing. Its wide variety of featu
- the shutdown command in linux for shutdown in time or reboot
- Get and display the size of file and directory in Linux system using du command 获取和现实linux文件大小(三)
- the diary of script in linux
- Abuse of the Linux Kernel for Fun and Profit
- Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
- Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance
- The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain(转)
- Windows Administration at the Command Line for Windows 2003, Windows XP, and Windows 2000: In the Fi