Linux

From BC$ MobileTV Wiki
Revision as of 02:10, 1 May 2022 by Bcmoney (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Linux is the name given to a series of computer operating systems which are derived from a reverse-engineered version of the UNIX kernel originally written by Linus Torvalds as part of a PhD research project.


Distributions

[1] [2] [3] [4]

Debian

Ubuntu

Ubuntu


RedHat

[6] [7]

Fedora

CentOS

[10]

SUSE

OpenSUSE


Mandrake

OpenMandriva


xandros


Mint

Linux Mint is known as the best distribution for Security & Penetration Testing tools.


Slackware


ArchLinux


LiMo

Linux on Mobile is a foundation and working group dedicated to spreading the use of Linux on Mobile and handheld devices of all types.


Android

See also: Android


Permissions

Linux's Permissions have long been considered one of its biggest strengths.

Permissions are set in the following order:

User Group Other

For instance, when "only the User/Owner of the file can Read or Write the file, no one else can access in any other way":

-rw------- 

Another common setting is that "both the User/Owner and any Users in the Group owning the file can Read, Write, or Execute the file, everyone else can only Read or Execute it but not Write (modify) it":

drwxrwxr-x 

chown

Change the ownership of a file:

chown <USERNAME> <FILENAME>

Change the ownership of a set of files in a directory recursively:

chown <USERNAME> -R <DIRECTORY>

For example:

chown myuser -R /opt/SomeDir/SomeFile.txt

[16] [17] [18] [19] [20] [21]

chmod

Modify the permissions for the ways a file can be accessed by certain roles:

chmod <PERMISSIONS> <FILENAME>

For example:

chmod 755 /opt/SomeDir/SomeFile.txt

[22] [23] [24] [25] [26]

Commands

systemctl

Service Management to run applications on startup/reboots.

Systemd


tcpdump

 tcpdump -A -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
 tcpdump -X -s 0 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'


scp

Secure-file CoPy (commonly abbreviated as scp) is a standard Linux/Windows library for copying the contents of a file. It is a rare example of a command which works in both the MS-DOS Command Prompt.

To copy from your local system to a remote directory:

scp -r <FILE_OR_FOLDER> <USERNAME>@<DOMAIN>:/some/remote/directory/

To copy from a remote directory to your local system:

scp <USERNAME>@<DOMAIN>:<FILE_OR_FOLDER> /some/local/directory/


install

[31]


watch

Watch in real-time for updates to a particular file or folder.

watch -n 10 -d <COMMAND>

For example:

watch -n 10 -d tail -f error.log

This will listen and update every 10 seconds for a specific command. The command could be anything from "ls -l <DIRECTORY>" to watch for files being added to or changed within a given directory (say "/var/messages/"), to "tail -ef <FILE>" to listen for updates to a log file.

tail

Tool for viewing the "tail end" of a file, however you can also use it to view the majority of its contents (even full contents, like "cat"), depending on the arguments passed in.

tail -ef <FILENAME>


grep

Global Regular Expression Printer (grep) is a tool to filter and/or search through the contents of a file from the command-line in Linux/Unix. It is commonly used on plain-text data sets for finding or "grepping out" lines that match a given regular expression

Example of finding the location of Apache Web Server from the list of running processes:

ps -ef | grep apache

[32]


ack

Long-running Processes

nohup

Long-running processes that can live outside of the terminal/command window they were called/run from are possible using a combination of nohup command prefix and the & ampersand process indicator. Using just & allows you to silence other commands that would normally get sent to that process, so you can continue working and running other commands in the same terminal while that process runs; using just nohup will prevent the hangup/kill signals from stopping your process (for instance if you use CTRL+C or CTRL+Z and intend to stop other processes while working in the same window, it will not run your process run with nohup); finally, using both nohup and & would allow a process to run after the terminal/command prompt it was run from gets closed. This is one step lower than running as an actual service, the only difference being that processes will need to be run manually (or by some additional scripted process), whereas services will run automatically immediately upon login.[34][35].

[37][38]


sar


Tools

[39]

Samba

Samba is a free software re-implementation of the SMB/CIFS networking protocol. Samba is an important component to seamlessly integrate Linux/Unix Servers and Desktops into Active Directory environments. It can function both as a domain controller or as a regular domain member.

[40] (Windows; commonly abberviated SMB one flavor of which is CIFS - Common Internet File System) [41] (Linux) [42] (Mac) [43] (Novell) [44] (legacy) [45] [46] [47] [48]

scp

Secure copy a file from one host (server) to another.


Resources


Tutorials

[61] [62]


External Links


References

  1. DistroWatch - Top Linux Distros list: https://distrowatch.com/dwres.php?resource=major
  2. wikipedia: DistroWatch
  3. The Top Linux Distributions Of All Time: https://www.lifewire.com/top-linux-distributions-of-all-time-4084559
  4. Whatever happened to these (once) Red-Hot Linux Distros?: https://www.linux.com/news/whatever-happened-these-red-hot-linux-distros
  5. RedHat on DistroWatch: http://distrowatch.com/table.php?distribution=redhat
  6. RHEL docs -- Chapter 1 - Red Hat Software Collections (repos) 3.4: https://access.redhat.com/documentation/en-us/red_hat_software_collections/3/html/3.4_release_notes/chap-rhscl
  7. Red Hat Enterprise Linux -- (current/past version) release dates: https://access.redhat.com/articles/3078
  8. How To Install Wine 2.0 on CentOS, RHEL & Fedora : https://tecadmin.net/steps-install-wine-centos-rhel-fedora-systems/
  9. CentOS on DistroWatch: http://distrowatch.com/table.php?distribution=centos
  10. [HOWTO] Install phpMyAdmin in CentOS 5: http://www.khattam.info/howto-install-phpmyadmin-in-centos-5-2010-09-25.html
  11. SUSE on DistroWatch: http://distrowatch.com/table.php?distribution=suse
  12. The Perfect Setup - Mandrake/Mandriva 10.2: https://www.howtoforge.com/perfect_setup_mandrake_10_2
  13. wikipedia: Mandriva Linux
  14. Mandriva Linux is dead, but these 3 forked distros carry on its legacy: https://www.pcworld.com/article/2930369/mandriva-linux-is-dead-but-these-3-forked-distros-carry-on-its-legacy.html
  15. xandrOS on DistroWatch: http://distrowatch.com/table.php?distribution=xandros
  16. wikipedia: chown
  17. chmod basic tutorial: https://www.tutorialspoint.com/unix_commands/chown.htm
  18. Linux chown command - detailed tutorial: https://www.computerhope.com/unix/uchown.htm
  19. chmod guide: https://www.howtoforge.com/linux-chown-command/
  20. CHOWN command in Linux/Unix explained with examples: https://www.linuxnix.com/chown-command-linuxunix-explained-examples/
  21. 12 Linux Chown Command Examples to Change Owner and Group: http://www.thegeekstuff.com/2012/06/chown-examples
  22. wikipedia: chmod
  23. chmod guide: https://www.computerhope.com/unix/uchmod.htm
  24. chmod detailed tutorial: http://catcode.com/teachmod/
  25. chmod quick tutorial: https://www.tutorialspoint.com/unix_commands/chmod.htm
  26. 7 chmod Command Examples for Beginners: http://www.thegeekstuff.com/2010/06/chmod-command-examples
  27. Useful SystemD commands (hints for systemctl or systemctl vs chkconfig and service): https://dynacont.net/documentation/linux/Useful_SystemD_commands/
  28. How To Use Systemctl to Manage Systemd Services and Units: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
  29. Use tcpdump to get HTTP requests, response header and response body?: http://stackoverflow.com/a/16610385
  30. Packet Analysis - 15 TCPDUMP Command Examples: http://www.thegeekstuff.com/2010/08/tcpdump-command-examples/
  31. Linux 'Install' command overview: https://www.lifewire.com/install-linux-command-4091911
  32. Finding Apache configuration file (httpd.conf) location: http://www.commanigy.com/blog/2011/06/08/finding-apache-configuration-file-httpd-conf-location
  33. Tutorial -- How to Use ack & grep on Ubuntu 14.04: https://www.hostingadvice.com/blog/tutorial-use-ack-grep-linux/
  34. Starting Tomcat as a service on LINUX: https://stackoverflow.com/questions/9156425/starting-tomcat-as-a-service-on-linux
  35. Starting Tomcat as a Service on Linux: https://web.archive.org/web/20120225104407/http://www.spaceprogram.com/knowledge/tomcat_init_d.html
  36. details about nohup: https://www.computerhope.com/unix/unohup.htm
  37. /usr/local or /opt?: https://superuser.com/questions/122420/usr-local-or-opt
  38. What is /usr/local/bin?: https://unix.stackexchange.com/questions/4186/what-is-usr-local-bin
  39. Filesystem Hierarchy Standard (FHS): http://www.pathname.com/fhs/
  40. wikipedia: Server Message Block
  41. wikipedia: Network File System
  42. wikipedia: Apple Filing Protocol
  43. wikipedia: Service Advertising Protocol
  44. wikipedia: NetBIOS
  45. CIFS vs SAMBA, What are the differences: http://unix.stackexchange.com/questions/34742/cifs-vs-samba-what-are-the-differences
  46. Common Internet File System: https://technet.microsoft.com/en-us/library/cc939973.aspx
  47. Just what is SMB?: https://www.samba.org/cifs/docs/what-is-smb.html
  48. Linux mount CIFS Windows Share: https://www.cyberciti.biz/faq/linux-mount-cifs-windows-share/
  49. 12 scp command examples to transfer files on Linux: http://www.binarytides.com/linux-scp-command/
  50. Linux Command Line Learning Resources (comprehensive list of links to Linux guides/books/man-pages): http://ubuntuforums.org/showthread.php?t=1909108&p=11611291
  51. Linux distribution popularity trends plotted: http://deviceguru.com/linux-distribution-popularity-trends/
  52. The Top 10 Linux Distributions Of All Time: https://www.lifewire.com/top-linux-distributions-of-all-time-4084559
  53. 10 of the Most Popular Linux Distributions Compared: https://www.howtogeek.com/191207/10-of-the-most-popular-linux-distributions-compared/
  54. What is a TTY on Linux? (and How to Use the tty Command): https://www.howtogeek.com/428174/what-is-a-tty-on-linux-and-how-to-use-the-tty-command/
  55. Unix - Mac OS X - "grep" command man pages: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/grep.1.html
  56. Untar a File in Linux/Ubuntu: http://www.hostingadvice.com/how-to/untar-file-linuxubuntu/
  57. A Guide to Kill, Pkill and Killall Commands to Terminate a Process in Linux: https://www.tecmint.com/how-to-kill-a-process-in-linux/
  58. How to pipe text from command line to the clipboard: https://superuser.com/questions/97762/how-to-pipe-text-from-command-line-to-the-clipboard
  59. HowTo -- Save The Output Of A Linux/Unix Command To A File: https://www.cyberciti.biz/faq/howto-save-ouput-of-linux-unix-command-to-file/
  60. How to copy a list of file names to text file?: https://superuser.com/questions/395836/how-to-copy-a-list-of-file-names-to-text-file
  61. How to check whether a directory is empty or not in Shell Scripting?: https://stackoverflow.com/questions/36245235/how-to-check-whether-a-directory-is-empty-or-not-in-shell-scripting
  62. Bash Shell Check Whether a Directory is Empty or Not: https://aws-labs.com/bash-shell-check-directory-empty/
  63. Installing the WAT on 64-bit Linux systems: https://docs.oracle.com/cd/E40520_01/wat.311/wat_install/src/t_installing_wat_on_unix.html

See Also

Unix | Ubuntu | Operating System | Server | Open Source | C | Android