Linux

38 flashcards · Computer Science · by Daniel Blackbird

  1. If you need to delete a directory, use the rmdir command.

    remove directory

  2. The touchcommand allows you to create a blank new file through the Linux command line. As an example, enter touch /home/username/Documents/Web.html to create an HTML file entitled Web under the Documents directory.

    new screen input

  3. To illustrate, grep blue notepad.txt will search for the word blue in the notepad file. Lines that contain the searched word will be displayed fully.

    search

  4. Use dfcommand to get a report on the system’s disk space usage, shown in percentage and KBs. If you want to see the report in megabytes, type df -m

  5. If you want to check how much space a file or a directory takes, the du (Disk Usage) command is the answer. However, the disk usage summary will show disk block numbers instead of the usual size format. If you want to see it in bytes, kilobytes, and megabytes, add the-h argument to the command line.

  6. chmod is another Linux command, used to change the read, write, and execute permissions of files and directories

  7. you can even download files from the internet with the help of the wget command

  8. The unamecommand, short for Unix Name, will print detailed information about your Linux system like the machine name, operating system, kernel, and so on.

  9. As a terminal equivalent to Task Manager in Windows, the top command will display a list of running processes and how much CPU each process uses. It’s very useful to monitor system resource usage, especially knowing which process needs to be terminated because it consumes too many resources.

  10. When you’ve been using Linux for a certain period of time, you’ll quickly notice that you can run hundreds of commands every day. As such, running history command is particularly useful if you want to review the commands you’ve entered before.

  11. If you want to know the name of your host/network simply type hostname. Adding a-I to the end will display the IP address of your network.

  12. Since Linux is a multi-user system, this means more than one person can interact with the same system at the same time. useradd is used to create a new user, while passwd is adding a password to that user’s account. To add a new person named John type,useradd John and then to add his password type,passwd 123456789.

  13. terminal commands :[Ubuntu] superuser DO Linux command Sudo

    (SuperUser DO) Linux command allows you to run programs or other commands with administrative privileges, just like “Run as administrator” in Windows. This is useful when, for example, you need to modify files in a directory that your user wouldn’t normally have access to.

  14. terminal commands :[Ubuntu] It is used to install, update, upgrade and remove any package. apt-get It is used to install, update, upgrade and remove any package. apt-get basically works on a database of available packages.

  15. terminal commands :[Ubuntu] update system database and let your system package update. sudo apt-get update with superuser privileges is the first command you need to run in any Linux system after a fresh install. This command updates the database and lets your system know if there are newer packages available or not.

  16. terminal commands :[Ubuntu] change user password using Terminal Passwd Ubuntu basic command is used to change user passwords using Terminal. What you have to do is run the below command

  17. terminal commands :[Ubuntu] the command displays more detailed or precise information of Man. Info Similar to man, but often provides more detailed or precise information.

  18. terminal commands :[Ubuntu] the command displays a “manual page”. man the command displays a “manual page”. Manual pages are usually very detailed, and it’s recommended that you read the man pages for any command you are unfamiliar with

  19. terminal commands :[Ubuntu] Displays the processes using top Displays the processes using the most system resources at any given time. “q” can be used to exit.

  20. terminal commands :[Ubuntu] basic information about the system. uname -a Provides a wide range of basic information about the system.

  21. terminal commands :[Ubuntu] upgrade the installed packages. sudo apt-get upgrade upgrade the installed packages. For upgrading all the packages with available updates you can use this command.

  22. terminal commands :[Ubuntu] removing the installed program sudo apt-get remove When it comes to removing the installed program apt-get remove command suits your need. You only have to know the exact package name of the software you want to uninstall.

  23. terminal commands :[Ubuntu] lists all files and folders in your current working directory. Ls (list) command lists all files and folders in your current working directory. You can also specify paths to other directories if you want to view their contents.

  24. terminal commands :[Ubuntu] change the current working directory. Cd (change director”) Linux command is also known as chdir used to change the current working directory. It’s one of the most used basic Ubuntu commands. Using this command is easy, just type cd followed by the folder name. You can use full paths to folders or simply the name of a folder within the directory you are currently working

  25. terminal commands :[Ubuntu] Takes you to the root directory. cd /

  26. terminal commands :[Ubuntu] Takes you up one directory level(back to previous folder ) cd ..

  27. terminal commands :[Ubuntu] Takes you to the previous directory cd -

  28. terminal commands :[Ubuntu] open home folder in the current directory cd home

  29. terminal commands :[Ubuntu] displays the full pathname of the current working directory. Pwd (print working directory) Ubuntu command displays the full pathname of the current working directory.

  30. terminal commands :[Ubuntu] copy a file Cp (copy) Linux command allows you to copy a file. You should specify both the file you want to be copied and the location you want it copied to – for example, cp xyz /home/myfiles would copy the file “xyz” to the directory “/home/myfiles”.

  31. terminal commands :[Ubuntu] (move) the command allows you to move files. You can also rename files by moving them to the directory they are currently in, but under a new name. The usage is the same as cp – for example mv xyz /home/myfiles would move the file “xyz” to the directory “/home/myfiles”. Mv (move) command allows you to move files. You can also rename files by moving them to the directory they are currently in, but under a new name. The usage is the same as cp – for example mv xyz /hom…

  32. terminal commands :[Ubuntu] removes the specified file. rm (remove) the command removes the specified file.

  33. terminal commands :[Ubuntu] Removes an empty directory. rmdir <name directory>

  34. terminal commands :[Ubuntu] Removes a directory along with its content. rm -r (“remove recursively”)

  35. terminal commands :[Ubuntu] create a new directory. Mkdir (make directory) the command allows you to create a new directory. You can specify where you want the directory created – if you do not do so, it will be created in your current working directory.

  36. terminal commands :[Ubuntu] displays information about the disk space usage of all mounted filesystems. df (display filesystem) the command displays information about the disk space usage of all mounted filesystems.

  37. terminal commands :[Ubuntu] displays the size of a directory and all of its subdirectories du (directory usage) the command displays the size of a directory and all of its subdirectories.

  38. terminal commands :[Ubuntu] Displays the amount of free space available on the system. free Displays the amount of free space available on the system.