Wednesday, June 29, 2022
  • Events
  • Interviews
  • Jobs
  • Opinion
  • Whitepapers
  • Glossary
  • Community Forum
  • Web Hosting Directory
  • Login
  • Register
Cloud7 News
  • Cloud Computing
  • Web Hosting
  • Data Center
  • Linux
  • Cybersecurity
  • More
    • Network/Internet
    • Windows
    • Software
    • Hardware
    • Blockchain
    • Policy/Legislation
    • How-Tos
    • Troubleshooting
No Result
View All Result
Cloud7 News
  • Cloud Computing
  • Web Hosting
  • Data Center
  • Linux
  • Cybersecurity
  • More
    • Network/Internet
    • Windows
    • Software
    • Hardware
    • Blockchain
    • Policy/Legislation
    • How-Tos
    • Troubleshooting
No Result
View All Result
Cloud7 News
No Result
View All Result

Home > Article > Weekly tips & tricks: Linux #4

Weekly tips & tricks: Linux #4

This week we are providing easy yet useful tips and tricks that will accelerate you while using the Terminal.

Birol Bavas by Birol Bavas
May 21, 2022
in Article
4 min read
0 0
0
Weekly tips & tricks Linux #4
0
SHARES
21
VIEWS
Share on FacebookShare on TwitterShare on EmailFollow on Google News

We’ve prepared 7 great tips for Linux users who love to use the terminal screen. In this way, you will perform your transactions quickly by increasing the interaction in daily Linux use. You can become a terminal guru with these tips that you can use in many Linux distributions.

Table of Contents

  • Run multiple processes in a single command line
  • “If” condition for running multiple processes
  • Quick navigation in Terminal
  • Finding files
  • Shorten everything with the alias command
  • Writing the output of commands to a file
  • Securely transfer your files

Run multiple processes in a single command line

Let’s say you need to run multiple commands one after the other. Instead of running the commands one by one, we can say that the first command is finished with a semicolon, and it should go to the next command.

cd Desktop; touch cloud7news.txt; echo “Hello world” > cloud7news.txt; cat cloud7.txt;

When we examine the following command in a single line; we wanted it to go to the Desktop folder from the main directory, create a file named cloud7news.txt there, and write the text “Hello world” in it and display the text written in cloud7news.txt to the terminal. The result was successful as you can see:


“If” condition for running multiple processes

Double ampersand makes sure that the first command runs successfully for the second command to run. We simply use a conditional expression. Let’s try this condition with one of the frequently used commands, update/upgrade.

In the following command lines, we want to update the packages if the update command has been completed successfully on Debian or Ubuntu-based distributions:

sudo apt update && apt upgrade -y

Quick navigation in Terminal

Instead of holding down the left key in the terminal, we can go to the beginning of the command in one move by pressing CTRL+A. If we are going to continue to write your code, we can go to the end of the terminal line by pressing CTRL+E.


Finding files

Are you using a Linux operating system and looking for a file you have already created? For this, I want to tell you about the “find” command. Let’s take a look at how the command works:

Syntax of “find” command

find [options] [path…] [expression]

Example

find /home/cloud7/Desktop -type f -iname cloud7news.txt

If you want to do a case-sensitive search, change the -iname part to -name.


Shorten everything with the alias command

Sometimes it can be boring to write long commands, so I can recommend you the alias command to make better use of your time. Thus, thanks to an alias you will create, you will avoid typing the same commands over and over.

Type alias in the terminal to view the currently existing aliases:

Let’s create an alias that might be useful. We may need to update packages frequently. So let’s shorten the command sudo yum update && sudo yum upgrade -y by specifying an alias update:

alias yupdate="sudo yum update && sudo yum upgrade -y"

Writing the output of commands to a file

The > and >> operators make sure the output of the commands used before them will be written in the target files. Here is the syntax for them:

ps aux > cloud7.txt
ps aux >> cloud7.txt

The first command directly rewrites the target file with the output of the ps aux command every time it is used. The second one on the other hand, simply adds lines to the end of the file like a log file.


Securely transfer your files

With SCP (Secure Copy), you can securely transfer files between two locations. During the transfer process, the traffic is encrypted and your sensitive data is securely transferred to the destination. There are many things you can do with the SCP command.

  • You can transfer data from the local system to a remote server.
  • You can transfer data from a remote server to your local system.
  • You can share files between two remote systems and each other.

Syntax of “scp” command

scp [option] [[email protected]_HOST:]file1 [user:@DEST_HOST:] file2

Let’s transfer data from your local system to a remote server

scp file.txt [email protected]:/directory/

Let’s transfer data from a remote server to your local system

scp [email protected]:/remote/file.txt /local/directory
ShareTweetSendShare
Birol Bavas

Birol Bavas

Birol Bavas is the operations & security manager of Cloud7. He has been building system architectures for several years. He is also a PHP and C# developer and has built countless web applications. For more than 10 years, he has been using Linux actively.

Leave a Reply Cancel reply

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

I agree to the Terms & Conditions and Privacy Policy.

Next Post

Snap app of the week: Glate

Related News

Weekly round-up 20 - 24 June

Weekly round-up: 20 – 24 June

June 25, 2022 1:00 pm
7 most realistic hacker movies

7 most realistic hacker movies

June 25, 2022 12:00 pm
Weekly round-up 13 – 17 June

Weekly round-up: 13 – 17 June

June 18, 2022 1:00 pm
10 gift ideas for tech-savvy fathers

10 gift ideas for tech-savvy fathers

June 18, 2022 11:00 am
Get free daily newsletters from Cloud7 News Get the Cloud7 Newsletter

Check your inbox or spam folder to confirm your subscription.

By subscribing, you agree to our
Copyright Policy and Privacy Policy

Editor's Choice

Interview with Igor Seletskiy on AlmaLinux

7 best hosting control panels

How to update Linux Kernel without rebooting?

7 best Linux mail servers for 2022

7 best cPanel alternatives for 2022

7 best Linux web browsers for 2022

7 best CentOS alternatives

7 best Linux server distros for 2022

How to scan your server for Log4j (Log4Shell) vulnerability

10 Best Web Hosting Services of 2022

AlmaLinux 8.6 Stable is ready to download

Ubuntu 22.04 LTS is available for download. What is new?

Kali Linux 2022.2 is ready for download

Advertisement

Recent News

  • Many Kubernetes instances are exposed to the internet
  • Firefox 102 released with Query Parameter Stripping
  • Mitre releases 2022’s most dangerous bugs
  • Nvidia has released the 515.57 display driver
  • Memory corruption vulnerability found in OpenSSL v3.0.4

Our Latest Interview

Interview: Erez Barak, Vice President Observability of Sumo Logic
Interview

Interview: Erez Barak, Vice President Observability of Sumo Logic

by Atalay Kelestemur
November 25, 2021 3:23 am


Cloud7 News is a news source that publishes the latest news, industry news and exclusive interviews on web hosting, cloud computing, data center, cybersecurity and linux.

News Categories

  • Web Hosting
  • Cloud Computing
  • Data Center
  • Cybersecurity
  • Linux
  • Network/Internet
  • Software
  • Hardware
  • Blockchain

Our Free Modules

  • Events
  • Interviews
  • Jobs
  • Opinion
  • Whitepapers
  • Glossary
  • Community Forum
  • Web Hosting Directory

Get the Cloud7 Newsletter

Get FREE daily newsletters from Cloud7 delivering the latest news and reviews.

  • About
  • Privacy & Policy
  • Copyright Policy
  • Contact

© 2022, Cloud7 News. Latest Cloud Computing, Web Hosting, Data Center Industry and Tech News

No Result
View All Result
  • Cloud Computing
  • Web Hosting
  • Data Center
  • Linux
  • Cybersecurity
  • More
    • Network/Internet
    • Windows
    • Software
    • Hardware
    • Blockchain
    • Policy/Legislation
    • How-Tos
    • Troubleshooting
  • Events
  • Interviews
  • Jobs
  • Opinion
  • Whitepapers
  • Glossary
  • Community Forum
  • Web Hosting Directory

© 2022, Cloud7 News. Latest Cloud Computing, Web Hosting, Data Center Industry and Tech News

Welcome Back!

Sign In with Facebook
Sign In with Google
Sign In with Linked In
OR

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Sign Up with Facebook
Sign Up with Google
Sign Up with Linked In
OR

Fill the forms below to register

*By registering into our website, you agree to the Terms & Conditions and Privacy Policy.
All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In
This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.