To manage a Linux remote machine like a virtual private server (VPS), system administrators commonly use a command-line interface (CLI). While some Linux distributions offer a graphical user interface (GUI), commands are more efficient and flexible with a CLI.
For example, you can replace specific entries in multiple files using a single command, which takes time in a GUI. However, using bash shell can be tricky since Linux has many commands for various tasks.
To run Linux commands in a remote server, connect via SSH using PuTTY or Terminal. Alternatively, Hostinger VPS hosting users can leverage our built-in Browser terminal to run the commands directly from their web browsers.
To create a folder within a directory, use the path as the command parameter. For example, mkdir music/songs will create a songs folder inside music. Here are several common mkdir command options:
Linux lets users edit files using a text editor like nano, vi, or jed. While most distributions include nano and vi, users must install jed manually. All these tools have the same command syntax:
The global regular expression or grep command lets you find a word by searching the content of a file. This Linux command prints all lines containing the matching strings, which is useful for filtering large log files.
The script contains the searched regular expression pattern, the replacement string, and subcommands. Use the s subcommand to replace matching patterns or d to delete them.
The action can be mathematical operations, conditional statements like if, output expressions such as print, and a delete command. It also contains the $n notation, which refers to a field in the current line.
The locate command lets you find a file in the database system. Add the -i option to turn off case sensitivity and an asterisk (*) to find content with multiple keywords. For example:
The ps command creates a snapshot of all running processes in your system. Executing it without an option or argument will list the running processes in the shell with the following information:
Replace target with a domain name. By default, this command only shows A record type. Change query_type to check a specific type or use ANY to query all of them. To run a reverse DNS lookup, add the -x option and use the IP address as the target.
apt-get is a command line tool for handling Advanced Package Tool (APT) libraries in Debian-based Linux, like Ubuntu. It requires sudo or root privileges.
Did you know that you can edit a text file with Linux commands using SSH? Instead of editing a file locally and uploading it via FTP, you can edit the file instantly on your account using the vim or nano command.
Hostinger offers a GPT-powered VPS AI Assistant that lets you easily generate Linux commands to manage your server. It is available in all VPS plans and accessible from the VPS overview side menu in hPanel.
Since there are many Linux commands with various syntaxes, remembering them can be difficult. To help you easily find a utility, download our must-have free Linux Commands Cheat Sheet PDF here:
When operating on the Linux command line, it is easy to get disoriented, which can have disastrous consequences. I once issued a remove command before realizing that I'd moved the boot directory of my computer. I learned to use the pwd command to know exactly which part of the file system I was in (and these days, there are command projects, like trashy and trash-cli, that serve as intermediates when removing files).
When I was new to Linux, I had a cheat sheet that hung over my desk to help me remember those commands as I managed my Linux servers. It was called the 101 commands for Linux cheat sheet. As I became more familiar with these commands, I became more proficient with server administration.
The pwd command prints your working directory. In other words, it outputs the path of the directory you are currently working in. There are two options: --logical to display your location with any symlinks and --physical to display your location after resolving any symlinks.
Coming from MS-DOS, I was used to listing files with the dir command. I don't recall working on Linux at the time, although today, dir is in the GNU Core Utilities package. Most people use the ls command to display the files, along with all their properties, are in a directory. The ls command has many options, including -l to view a long listing of files, displaying the file owner and permissions.
Removing files is inherently dangerous. Traditionally, the Linux terminal has no Trash or Bin like the desktop does, so many terminal users have the bad habit of permanently removing data they believe they no longer need. There's no "un-remove" command, though, so this habit can be problematic should you accidentally delete a directory containing important data.
Renaming and moving a file is functionally the same process. When you move a file, you take a file from one directory and put it into a new one. When renaming a file, you take a file from one directory and put it back into the same directory or a different directory, but with a new name. Either way, you use the mv command:
While administering your system, it may be necessary to act as the super user (also called root). This is where the sudo (or super user do) command comes in. Assuming you're trying to do something that your computer alerts you that only an administrator (or root) user can do, just preface it with the command sudo:
There are actually many ways to shut down your computer and some variations on the process. For instance, the shutdown command allows you to power down your computer after an arbitrary amount of time, such as 60 seconds:
However, there are some third-party solutions. For example, Termux community provides terminal emulator and Linux environment for Android, as well as own package manager and extensive collection of many precompiled applications. This command in Termux app will install the last available Node.js version:
That command was not installed. I used the instructions in Install - Dropbox to install Dropbox. Using those instructions, a Dropbox directory was created with the contents of my Dropbox as it existed when I did the installation.
@SoCalSam, On the page you linked to are different instructions (2 groups actually). If you have followed the first group, then you should have the command installed (it's internal part of the package). If you have followed the second group (as seems to be), then you have installed ( by hands, not a package) just the daemon without anything else (including without the control script 'dropbox'). In the second case you need to download and install the control script independently (as noted in the same page) again by hands or install some package (you probably installed rpm).
No. Very different meaning. I am trying to say that when I use /.dropbox-dist/dropboxd I cannot do anything else and you are saying that I just cannot execute another daemon. Very different meanings. When I issue that command I get the following in my command window:
Ahh... I didn't suppose you miss basic console work knowledge. ?
Ok. In terminal, by default, when some command is run, the shell passes control there and wait for command end. Once the command ends, the shell continue its regular work (usually shows command prompt). In above screenshot you're running Dropbox daemon directly!!! It will keep running until you stop it; so new prompt will not show again until daemon stop. As I said this is by default. You can detach particular command and let it run without shell waits for it using ending ampersand (&); so the shell will show command prompt immediately after run (keep in mind that the command outputs will still dup to the terminal if you don't detach them too). In this context your command from the screenshot can change to something like:
After that you have 'dropbox' command installed already. Using this control script you don't need to detach (add ampersand at the end) anything explicitly (it's done by the script automatic). Try repeat the advices from my previous post now.
Basic linux commands are introduced for non Linux users. Commands are the most staightforward way for a user to interact with the Linux operating system (OS). Linux OS gives the user application access to computer resources (CPU, memory, disks, devices, etc) through a file-system. A Linux Shell is a commonly used interface that enables users to access the OS services. Shells are usually available through a terminal, SSH (secure shell) connection, or else. After opening a terminal, or after establishing a SSH connection, the user can enter commands into the shell prompt line. This quick help provides a list of usage examples of some basic commands. In the following example code, lines starting with the dollar symbol $ (also called shell prompt) indicate commands to be entered.
Commands are case-sensitive words made of symbols and alphabetical letters (examples: hmac256, ssh-copy-id) that allow the user to run programs or to perform shell operations. Commands may have parameters and arguments that control the operations to be made. A command or a combination of commands with or without parameters is called a command line. There are different methods to obtain information about a given command. Three common methods are
df19127ead