Friday, February 3, 2023
  • 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 Birol Bavas
May 21, 2022
4 min read
Weekly tips & tricks Linux #4

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
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

Snap app of the week: Glate

Related News

Weekly round-up 23 – 27 January

Weekly round-up: 23 – 27 January

January 28, 2023 10:30 pm
What is ChatGPT Everything you need to know

What is ChatGPT? Everything you need to know

January 28, 2023 7:00 pm
What is cloud orchestration

What is Cloud Orchestration?

January 28, 2023 5:09 pm
Weekly round-up 16 – 20 January

Weekly round-up: 16 – 20 January

January 21, 2023 10:00 pm
Get free daily newsletters from Cloud7 News Get the Cloud7 Newsletter
Select list(s):

Check your inbox or spam folder to confirm your subscription.

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

Get the free newsletter

Subscribe to receive the latest IT business updates straight to your inbox.

Select list(s):

Check your inbox or spam folder to confirm your subscription.

Editor's Choice

What’s new in Linux kernel 6.2 rc6?

10 Best Web Hosting Services of 2023

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

CERN and Fermilab recommend AlmaLinux

7 best hosting control panels of 2023

How to update Linux Kernel without rebooting?

7 best Linux mail servers of 2023

7 best cPanel alternatives for 2023

7 best Linux web browsers for 2023

7 best CentOS alternatives

7 best Linux server distros of 2023

Interview with Igor Seletskiy on AlmaLinux

How to create a VM on VMware Workstation

Recent News

  • LibreOffice 7.5 Community is released. What’s new?
  • NTT to add Palo Alto Networks’ solution to its portfolio
  • Gcore announces partnership with Super Protocol
  • Fortinet is expanding its SOC offerings portfolio
  • Radware announces a new partner program

Cloud7 News
Cloud7 is a news source that publishes the latest news, reviews, comparisons, opinions, and exclusive interviews to help tech users of high-experience levels in the IT industry.

EXPLORE

  • Web Hosting
  • Cloud Computing
  • Data Center
  • Cybersecurity
  • Linux
  • Network/Internet
  • Software
  • Hardware
  • How-Tos
  • Troubleshooting

RESOURCES

  • 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

© 2023, Cloud7 News. All rights reserved.

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

© 2023, Cloud7 News. All rights reserved.

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.