Linux / Unix Command Examples

Here are links to some useful Linux tips:

https://www.cyberciti.biz/faq/linux-unix-appleosx-bsd-cat-command-examples/

https://peteris.rocks/blog/htop/

https://www.cyberciti.biz/faq/searching-multiple-words-string-using-grep/

https://www.cyberciti.biz/faq/using-sed-to-delete-empty-lines/

https://www.cyberciti.biz/faq/linux-hide-processes-from-other-users/

https://www.cyberciti.biz/faq/bash-check-if-process-is-running-or-notonlinuxunix/

https://www.cyberciti.biz/faq/unix-linux-bsd-appleosx-bash-assign-variable-command-output/

http://unixmillenniumbug.com/

https://bash.cyberciti.biz/file-management/linux-shell-script-to-reduce-pdf-file-size/

https://www.cyberciti.biz/faq/bash-file-command-not-found-how-to-install-file/

https://www.cyberciti.biz/faq/set-up-a-basic-iptables-firewall-on-amazon-linux-ami/

https://www.cyberciti.biz/faq/fedora-redhat-centos-5-6-disable-firewall/

https://bash.cyberciti.biz/virtualization/shell-script-to-setup-an-lxd-linux-containers-vm-lab-for-testing-purpose/

https://hackertarget.com/ossec-introduction-and-installation-guide/

Awesome. VIM “for people who don’t want to use it , but have to…”. Or see my page https://www.cyberciti.biz/faq/linux-unix-vim-save-and-quit-command/

sudo is the right choice for granting admin rights on the CentOS Linux 8 server. Learn how to create a new user and grant her admin rights https://www.cyberciti.biz/faq/add-create-a-sudo-user-on-centos-linux-8/

643 Comments

  1. Tomi Engdahl says:

    https://hackaday.com/2023/05/24/linux-fu-making-progress/

    The pv program can do some of the things you want. It monitors data through a pipe or, at least through its standard output. Think of it as cat with a meter.

    By default, pv will show a progress bar, an elapsed time, an estimated end time, a rate, and a total number of bytes. You can turn any of that off or add things using command line options. You can also specify things like the size of the terminal if it should count lines instead of bytes, and, in the case where the program doesn’t know what it is reading, the expected size of the transfer.

    Of course, the output of pv is to stderr so it shows up on the screen. This makes it tricky if you want to use it with something like dialog that wants the stdout to be the progress indication. Luckily, you can redirect stderr to stdout and then redirect stdout to a file. Just be sure to do it in that order.

    Another Way

    There is also progress. It looks around for programs running like cp, mv, dd, and many more, looks at their open files, and shows you progress information for those programs. It only does this once, so you’ll typically marry it with the watch command or use the -M option.

    Note that since gzip is one of the programs that progress knows about

    As usual with Linux, there are always many ways to do anything. If you are a masochist, you could use ptrace to look inside a program and figure things out from there. You could also do the same trick that progress does and look through a program’s /proc entries.

    If you want to add a progress bar to your shell scripts directly, try gum. Or maybe combine progress with widgets to put the result on your desktop?

    Reply
  2. Tomi Engdahl says:

    https://github.com/uutils/coreutils
    Cross-platform Rust rewrite of the GNU coreutils

    Reply
  3. Tomi Engdahl says:

    https://www.facebook.com/groups/2600net/permalink/3676867062536392/

    Steve Wilson lol had this random idea to pipe a USB connection over SSH. you can totally do it lol.

    On your local machine: ssh -R1234:localhost:1234 [email protected]

    This opens port 127.0.0.1:1234 on remote.example.com which then connects to 127.0.0.1:1234 on your local machine.

    Now you use socat to connect to the serial line of your USB:

    On your local machine: socat -d -d -d tcp-listen:1234,reuseaddr,fork,bind=127.0.0.1 /dev/ttyUSB0

    TCP -> Pipe
    On the other side, if the software cannot use TCP but wants to talk to a pipe or tty, you can use socat again to provide that:

    On the remote: socat -d -d -d unix-listen:.mypipe tcp-connect:127.0.0.1:1234

    Now let your remote software connect to .mypipe and it is transparently connected to /dev/ttyUSB0 on your local computer.

    But your mileage may vary. It depends heavily what your software in the cloud needs.

    End quote.

    Now FIGHT!!! and tell him how this is impossible, 2600 “hackers”.

    #2600 #hackers #learnsomethingnew #2600net #usbhacks #linux #socat

    Reply
  4. samm says:

    To use different command in Linux

    Reply

Leave a Reply to Tomi Engdahl Cancel reply

Your email address will not be published. Required fields are marked *

*

*