Updated: 21 May 2023
Change file timestamps.
View access, modify, change and birth timestamps
stat filename
Change only the access time
touch -a filename
Change only the modification time
touch -m filename
Freelance software engineer United Kingdom
Updated: 21 May 2023
Change file timestamps.
View access, modify, change and birth timestamps
stat filename
Change only the access time
touch -a filename
Change only the modification time
touch -m filename
Updated: 24 April 2023
Show only the 10 most recent files in a directory:
ls -t | head
Updated: 23 April 2023
Search through a directory of csv files and display the results in a table:
grep --color=always -h -r "70\.00" my-csv-files | sed "s/^[ \t]*//" | column -t -s,
--color=always preserve match colour, even after piping.-h do not show filenames.-r search through all files in directories.sed "s/^[ \t]*//" remove leading whitespace from lines.-t create a table.-s, specify the separator to use.Updated: 16 May 2024
Make a symbolic link points-to-foo which points to foo
ln -s foo points-to-foo
Updated: 11 March 2023
Extract a tar ball to the current directory
tar -x -f music.tar
Updated: 30 January 2023
Display a line of text but do not output the trailing newline
echo -n foo > delete-me.txt
Updated: 11 January 2023
Show last 3 lines of a file
tail -n 3 /my/file.cs
Updated: 28 February 2025
Install xclip
sudo apt install xclip
Pipe command to primary (middle mouse button) clipboard
cmd | xclip
Pipe command to ‘clipboard’ clipboard, for pasting into another application
cmd | xclip -sel clip
Copy contents of file to clipboard, for pasting into another application
xclip -sel clip file.txt
Updated: 14 March 2025
Displays a calendar and the date of Easter
Install ncal
sudo apt install ncal
Show a calendar in the terminal
ncal -Cy
Show the calendar for year 1956
ncal -Cy 1956
Updated: 21 May 2023
Append contents of all matching files to sum.log
cat *.log >> sum.log
Overwrite sum.log with contents of all matching files
cat *.log > sum.log