Fix typos
This commit is contained in:
parent
fc70fcde1f
commit
e87b40ee92
|
@ -35,12 +35,13 @@ opportunity to learn about computers, files, directories and programs.
|
|||
* [[./tutorial/rsync.org][Using rsync to copy files]]
|
||||
* [[./tutorial/search_files.org][Searching for files in the system]]
|
||||
* [[./tutorial/diff.org][Comparing two files or directories: 'diff']]
|
||||
* [[./tutorial/diff_patch.org][Comparing two files and create a unified version: diff and patch]]
|
||||
* [[./tutorial/dd_command_flash_usb.org][Using dd command to flash usb]]
|
||||
* [[./tutorial/compress_pdf.org][Compress a pdf file]]
|
||||
* [[./tutorial/luakit.org][Searching and editing configuration files]]
|
||||
* [[./tutorial/pacman.org][Use package manager in Parabola GNU-linux: verify packages in cache]]
|
||||
* [[./tutorial/removing_packages.org][Removing packages in Parabola GNU-Linux]]
|
||||
* [[./tutorial/diff_patch.org][diff and patch]]
|
||||
|
||||
|
||||
** Disk space utilization and manipulation
|
||||
|
||||
|
|
|
@ -1,100 +0,0 @@
|
|||
#+TITLE: bash commands
|
||||
#+DATE: 2021-08-30
|
||||
#+STARTUP: indent
|
||||
#+OPTIONS: num:nil
|
||||
|
||||
* DONE work in bash tutorial
|
||||
:LOGBOOK:
|
||||
CLOCK: [2021-09-08 mié 18:52]--[2021-09-08 mié 19:22] => 0:30
|
||||
CLOCK: [2021-09-04 sáb 16:04]--[2021-09-04 sáb 16:34] => 0:30
|
||||
CLOCK: [2021-09-04 sáb 15:19]--[2021-09-04 sáb 15:49] => 0:30
|
||||
:END:
|
||||
|
||||
|
||||
|
||||
* Execute stuffs
|
||||
|
||||
|
||||
* Show command history
|
||||
|
||||
: history
|
||||
|
||||
The file can be found in the user home:
|
||||
|
||||
: /home/user/.bash_history
|
||||
|
||||
|
||||
|
||||
|
||||
** Backup a file
|
||||
|
||||
Using "cp"
|
||||
|
||||
: cp bbdb{,.bak}
|
||||
|
||||
: bbdb.bak
|
||||
|
||||
Backups with tar (tape archiver)
|
||||
|
||||
Back up of "home"
|
||||
|
||||
* c = create file
|
||||
* v = verbose
|
||||
* f = write to a file/device
|
||||
* z = compress the file (gzip) "tar.bz"
|
||||
* j = compress the file (bzip2)
|
||||
|
||||
: tar -czvf /tmp/home.tar.gz /home
|
||||
|
||||
** Simple code to encrypt
|
||||
|
||||
Encrypt:
|
||||
|
||||
: gpg -c X
|
||||
: gpg X
|
||||
|
||||
Use the code to remove the original file:
|
||||
|
||||
: shred --remove X
|
||||
|
||||
|
||||
** Download files
|
||||
|
||||
This code download the file and the argument ~-O~ is to rename the file
|
||||
|
||||
#+begin_example
|
||||
wget https://filetodownload.org -O new_file
|
||||
#+end_example
|
||||
|
||||
* Devices
|
||||
|
||||
- mount /what /where
|
||||
- what = device name
|
||||
- where = directory
|
||||
- /mnt = devices that mount occasionally
|
||||
- /media = devices that mount frequently
|
||||
|
||||
: run/$USER/media/$LABEL
|
||||
|
||||
|
||||
* Evaluate time to load
|
||||
|
||||
In emacs:
|
||||
|
||||
: time emacs --eval '(save-buffers-kill-terminal)'
|
||||
|
||||
* Cool commands
|
||||
|
||||
: cal # calendar
|
||||
: clear # clear output
|
||||
: uname # display system information (-r, -p, -a)
|
||||
: wc # wordcount (file name)
|
||||
: date # check the date
|
||||
|
||||
|
||||
* References:
|
||||
|
||||
* [[https://wiki-dev.bash-hackers.org/][The bash hackers wiki]]
|
||||
* [[https://link.springer.com/content/pdf/bfm%3A978-1-4302-6829-1%2F1.pdf?error=cookies_not_supported&code=2e41714e-ca8f-4796-a077-3243c836ec90][Beginning the linux command line]]
|
||||
* [[https://pandoc.org/][Pandoc manual]]
|
||||
* [[https://stackoverflow.com/][stackoverflow]]
|
|
@ -1,4 +1,5 @@
|
|||
#+options: toc:nil num:nil
|
||||
#+date: 2022-09-24
|
||||
|
||||
* Comparing the content of two files or directories
|
||||
|
||||
|
@ -9,22 +10,29 @@
|
|||
To compare the content of two files use something like
|
||||
|
||||
#+begin_example bash
|
||||
diff file1.txt file2.txt
|
||||
diff file1.txt file2.txt
|
||||
#+end_example
|
||||
|
||||
You can redirect the output to a file and make a patch: a file containing the differences between both files
|
||||
|
||||
#+begin_example bash
|
||||
diff file1.txt file2.txt patch.txt
|
||||
diff file1.txt file2.txt > patch.txt
|
||||
#+end_example
|
||||
|
||||
** Comparing directories
|
||||
|
||||
Some arguments may be hepful to have an output showing the differences between two directories:
|
||||
~--brief~ (show only the differences) and ~-r~ (compare the directories that are located within the main directory also)
|
||||
~--brief~ (show only the differences) and ~-r~ (compare the directories that are located within the main directory also)
|
||||
|
||||
#+begin_example bash
|
||||
diff --brief -r directory1 directory2
|
||||
#+end_example
|
||||
|
||||
Another approach to compare all the files within each directory is to use:
|
||||
|
||||
- ~q~ : Shows only differences
|
||||
- ~r~ : Run the command recursively
|
||||
|
||||
#+begin_example bash
|
||||
diff -qr directory1 directory2
|
||||
#+end_example
|
||||
|
|
|
@ -45,9 +45,3 @@ Remove all of uninstalled packages in cache
|
|||
...90.88 Mib
|
||||
|
||||
|
||||
Run this to see issues in the system
|
||||
|
||||
#+begin_example sh
|
||||
journalctl -p 3 -xb
|
||||
#+end_example
|
||||
|
||||
|
|
Loading…
Reference in New Issue