Ubuntu: Up and Running by Nixon Robin
Author:Nixon, Robin [Robin Nixon]
Language: eng
Format: epub
Tags: COMPUTERS / Operating Systems / Linux
ISBN: 9781449390730
Publisher: O'Reilly Media
Published: 2010-04-11T16:00:00+00:00
Figure 7-15. The result of displaying files.txt
But what if you want to know which files and folders were created first? The answer would be to sort them by column 6, and you could use this command to do it:
ls -al | sort -k6 > ~/files.txt
Redirecting Input
If you need to keep the file sorted alphabetically but still wish to sometimes view the lines in date order, you can issue the following command on it instead:
sort -k6 < ~/files.txt
This opens up files.txt, reads it in, and passes its contents to the command immediately preceding the < symbol.
You could even extend that to use the less command by adding the | operator:
sort -k6 < ~/files.txt | less
This works because the > and < operators work on files and devices, whereas the | operator creates pipes between commands. Therefore, sort -k6 < ~/files.txt is seen as a complete command in its own right, the output of which can be displayed or, as in this case, piped to another command.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7770)
Filmora Efficient Editing by Alexander Zacharias(5824)
The Infinite Retina by Robert Scoble Irena Cronin(5304)
Learn Wireshark - Fundamentals of Wireshark. by Lisa Bock(4000)
Linux Device Driver Development Cookbook by Rodolfo Giometti(3937)
Edit Like a Pro with iMovie by Regit(3448)
Linux Administration Best Practices by Scott Alan Miller(2863)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic & Jasmin Redzepagic(2838)
MCSA Windows Server 2016 Study Guide: Exam 70-740 by William Panek(2526)
Mastering PowerShell Scripting - Fourth Edition by Chris Dent(2420)
Docker on Windows by Stoneman Elton(2321)
Kali Linux - An Ethical Hacker's Cookbook: End-to-end penetration testing solutions by Sharma Himanshu(2317)
Creative Projects for Rust Programmers by Carlo Milanesi(2271)
Hands-On AWS Penetration Testing with Kali Linux by Karl Gilbert(2113)
Hands-On Linux for Architects by Denis Salamanca(2055)
Programming in C (4th Edition) (Developer's Library) by Stephen G. Kochan(2006)
Computers For Seniors For Dummies by Nancy C. Muir(2006)
The Old New Thing by Raymond Chen(1942)
Linux Kernel Debugging by Kaiwan N Billimoria(1765)
