linux_notes
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
linux_notes [2021/03/14 15:53] – [tasks] raju | linux_notes [2024/09/13 22:45] (current) – [tasks] raju | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== dummy ===== | ||
==== tasks ==== | ==== tasks ==== | ||
* [[add numbers on the command line]] | * [[add numbers on the command line]] | ||
* [[du on month end dates]] | * [[du on month end dates]] | ||
+ | * [[change the default shell]] | ||
+ | * [[Which shell am I using | Which shell am I using?]] | ||
+ | * [[Difference between SHELL and 0 | What is the difference between \$SHELL and \$0?]] | ||
+ | |||
+ | ==== what is my OS? ==== | ||
+ | < | ||
+ | awk -F= ' | ||
+ | </ | ||
+ | |||
+ | Sample run: | ||
+ | < | ||
+ | % cat / | ||
+ | PRETTY_NAME=" | ||
+ | NAME=" | ||
+ | VERSION_ID=" | ||
+ | VERSION=" | ||
+ | VERSION_CODENAME=bookworm | ||
+ | ID=debian | ||
+ | HOME_URL=" | ||
+ | SUPPORT_URL=" | ||
+ | BUG_REPORT_URL=" | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | % awk -F= ' | ||
+ | debian | ||
+ | </ | ||
+ | |||
+ | Ref: | ||
+ | * I came across it in https:// | ||
+ | |||
+ | ==== last reboot times ==== | ||
+ | < | ||
+ | last reboot --time-format full | ||
+ | </ | ||
+ | |||
+ | Sample run | ||
+ | < | ||
+ | % last reboot --time-format full | ||
+ | reboot | ||
+ | reboot | ||
+ | reboot | ||
+ | reboot | ||
+ | reboot | ||
+ | reboot | ||
+ | reboot | ||
+ | reboot | ||
+ | reboot | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | {{tag> | ||
+ | ==== ls and mv ==== | ||
+ | Sample command | ||
+ | < | ||
+ | ls -rt *.txt | tail -n5 | tr ' | ||
+ | </ | ||
+ | |||
+ | Notes: | ||
+ | * Works even if there are spaces in the filenames. Compare this with < | ||
+ | mv `ls -rt *.txt | tail -n5` x1 | ||
+ | </ | ||
+ | * Does not work if the filenames contain newline characters. | ||
+ | |||
+ | Ref:- https:// | ||
+ | |||
+ | Related commands | ||
+ | < | ||
+ | ls -rt *.txt | tail -n5 | tr ' | ||
+ | </ | ||
+ | ==== remove large directories ==== | ||
+ | |||
+ | Use rsync to delete large directories. | ||
+ | |||
+ | < | ||
+ | mkdir empty_dir | ||
+ | rsync -a --delete empty_dir/ | ||
+ | </ | ||
+ | |||
+ | As per https:// | ||
==== stackoverflow answers I came across ==== | ==== stackoverflow answers I came across ==== | ||
Line 16: | Line 97: | ||
Found it in | https:// | Found it in | https:// | ||
+ | |||
+ | ==== tput: unknown terminal " | ||
+ | When I moved my miniconda3 installation from / | ||
+ | < | ||
+ | tput: unknown terminal " | ||
+ | </ | ||
+ | |||
+ | To fix it, I did | ||
+ | < | ||
+ | conda install --force-reinstall ncurses | ||
+ | </ | ||
+ | |||
+ | It turns out that the --fore-reinstall option was important since simply doing | ||
+ | < | ||
+ | conda install ncurses | ||
+ | </ | ||
+ | was not installing ncurses as it was already uptodate. | ||
+ | |||
+ | Ref:- https:// | ||
linux_notes.1615737180.txt.gz · Last modified: 2021/03/14 15:53 by raju