Difference between revisions of "Linux Commands"

From Danleff Wiki
Jump to navigationJump to search
 
Line 76: Line 76:
  
 
*[https://www.youtube.com/watch?v=s72WS6xGpH8 Linux Commands for Beginners (Old Version): 27- Handling File Names With Spaces]
 
*[https://www.youtube.com/watch?v=s72WS6xGpH8 Linux Commands for Beginners (Old Version): 27- Handling File Names With Spaces]
 +
 +
===Merging PDF files===
 +
 +
*[[Pdf | Merging PDF files]]

Latest revision as of 15:28, 8 September 2019

Danleff (talk) 14:33, 30 April 2018 (UTC)

File/Directory Commands

Administrative access

username ALL=(ALL) ALL

  • To provide sudo access to a group, add the following line to the /etc/sudoers file.

%programmers ALL=(ALL) ALL

  • Remove a directory, even if files existed in that directory.
  1. rm -r directory
  2. add -f switch to prevent warning prompts.
  3. rm -rf dir – force remove directory dir *

Vi Commands

File Compression

  1. tar xzf file.tar.gz – extract a tar using Gzip
  2. tar xf file.tar – extract the files from file.tar
  3. tar xjf file.tar.bz2 – extract a tar using Bzip2



File Permissions

  • chmod 777 – read, write, execute for all
  • chmod 755 - wide open for user, read and executable for everyone else
  • chmod 644 - read and writable for user, readable by everyone else
    • numerical meanings
  1. 7 = 4+2+1 (read/write/execute)
  2. 6 = 4+2 (read/write)
  3. 5 = 4+1 (read/execute)
  4. 4 = 4 (read)
  5. 3 = 2+1 (write/execute)
  6. 2 = 2 (write)
  7. 1 = 1 (execute)chmod 755 – rwx for owner, rx for group and world
  1. rpm -q kernel
  2. yum remove <filename>
  3. yum list kernel-* will give you a list of installed and available packages.


  • List disk space usage
  1. df -Th
  • To list the drives and relevant partitions that are attached to your system, run:
  1. sudo fdisk -l

Change Root Password

   Type sudo -i in command line terminal.
   Give your user account password by which you logged in to the system.
   Now type "passwd".
   It will ask you for new root password.
   Type new root password and then retype it.
   Now type exit.

Filenames with Spaces

  1. \ (space)

Merging PDF files