Linux Resources
- Home
- Linux Resources
This article covers how you can easily install slack platform on your CentOS 8 Linux system through the command line.
Using a slack application, team members of an organization can unify all conversations from different sources.
Slack is one of the most popular collaboration platforms in the world that brings all your communication together.
Conversations in Slack are organized in channels.
You can create channels for your teams, projects, topics, or any other purpose.
You can search through everything that's been posted in channels or your messages.
Slack also allows you to talk with your teammates over audio or video calls and share documents, images, videos, and other files.
To Install Slack on CentOS:
1. Update system
sudo yum -y update
2. Download and Install Slack on CentOS
sudo yum -y install wget
wget https://downloads.slack-edge.com/linux_releases/slack-3.4.0-0.1.fc21.x86_64.rpm
sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum localinstall slack-3.4.0-0.1.fc21.x86_64.rpm
3. Start and Use Slack
Now that Slack is installed on your CentOS / RHEL 8 desktop, you can launch it through the command line,
$ slack
This article covers the different methods of finding files in Debian 10.
To find a file in Debian:
Use the Locate command
1. Debian and Ubuntu sudo apt-get install locate.
2. CentOS yum install locate.
3. Prepare locate command for first use. To update the mlocate.db database before first use, run: sudo updatedb.
To use locate, open a terminal and type locate followed by the file name you are looking for.
To locate a file in Linux:
1. find . - name thisfile.txt. If you need to know how to find a file in Linux called thisfile.
2. find /home -name *.jpg. Look for all . jpg files in the /home and directories below it.
3. find . - type f -empty. Look for an empty file inside the current directory.
4. find /home -user randomperson-mtime 6 -iname ".db".
To find packages in Debian:
You can also search for a package using the aptitude Ncurses user interface.
1. Type 'aptitude' in the terminal and the following interface will be displayed in the window.
2. To search for a package, press '/' and then type the package name into the search bar.
How to use grep to find a file?
The grep command searches through the file, looking for matches to the pattern specified.
To use it type grep , then the pattern we're searching for and finally the name of the file (or files) we're searching in.
The output is the three lines in the file that contain the letters 'not'.
To list files in Linux:
The easiest way to list files by name is simply to list them using the ls command. Listing files by name (alphanumeric order) is, after all, the default.
You can choose the ls (no details) or ls -l (lots of details) to determine your view.
Which command have more searching options to search a file in file system in Linux?
Grep is a Linux / Unix command-line tool used to search for a string of characters in a specified file. The text search pattern is called a regular expression.
When it finds a match, it prints the line with the result.
The grep command is handy when searching through large log files.
grep is a command-line utility for searching plain-text data sets for lines that match a regular expression.
Its name comes from the ed command g/re/p (globally search for a regular expression and print matching lines), which has the same effect.
To grep recursively in a directory:
To recursively search for a pattern, invoke grep with the -r option (or --recursive ). When this option is used grep will search through all files in the specified directory, skipping the symlinks that are encountered recursively.
This article covers how you can block/unblock ping requests to your Debian system. You will learn different ways for blocking/unblocking ping requests either temporarily or permanently.
The --query-icmp-block=<type> option can be used to determine if a type is confgured to allow or deny.
The --add-icmp-block=<type> option can be used to block a certain type.
The --remove-icmp-block=<type> option can be used to not block a certain type.
After adding or removing a block, reload the firewall.
To block ping requests in Linux:
1. Edit /etc/sysctl.conf. Add the following line to your /etc/sysctl.conf : net.ipv4.icmp_echo_ignore_all=1. Then: sysctl -p.
2. Using iptables: iptables -I INPUT -p icmp --icmp-type echo-request -j DROP.
3. With cron. Run crontab -e as root, then add the following line: @reboot echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all.
To block ping in iptables:
1. Add a rule that tells the iptables firewall to block ping in and out of a server by controlling the ICMP requests.
2. Remove the rule that tells the iptables firewall to allow ping in and out of a server by controlling the ICMP requests.
To enable ping on Linux server?
# iptables -D INPUT -p icmp --icmp-type echo-request -j REJECT D :
This command switch is used to delete the rule. Once the ping enabled, the server should now respond to ping requests
This article covers the method of creating and running a shell script in Linux Mint 20.
With this, you can write and execute complex shell scripts in Linux Mint 20 very easily.
To write and execute a script:
1. Open the terminal. Go to the directory where you want to create your script.
2. Create a file with . sh extension.
3. Write the script in the file using an editor.
4. Make the script executable with command chmod +x <fileName>.
5. Run the script using ./<fileName>.
To save a .sh file in Ubuntu:
1. Run nano hello.sh.
2. nano should open up and present an empty file for you to work in.
3. Then press Ctrl-X on your keyboard to Exit nano.
4. nano will ask you if you want to save the modified file.
5. nano will then confirm if you want to save to the file named hello.sh.
To Make a Bash Script Executable in Linux:
1) Create a new text file with a . sh extension.
2) Add #!/bin/bash to the top of it. This is necessary for the “make it executable” part.
3) Add lines that you'd normally type at the command line.
4) At the command line, run chmod u+x YourScriptFileName.sh.
5) Run it whenever you need!
This article covers how to install the Opera browser using different ways on CentOS 8. We have also shown how you can install packages by using the wget command. Opera browser is amazing on your CentOS 8 system.
To install Opera browser on CentOS:
1. Add Opera YUM repository
Run the following commands to manually add the Opera RPM repository to your RHEL / CentOS 8 system.
$ sudo tee /etc/yum.repos.d/opera.repo <<RPMREPO
[opera]
name=Opera packages
type=rpm-md
baseurl=https://rpm.opera.com/rpm
gpgcheck=1
gpgkey=https://rpm.opera.com/rpmrepo.key
enabled=1
RPMREPO
2. Install Opera Browser on RHEL 8 / CentOS 8
Use yum package manager command to install Opera Browser on RHEL 8 / CentOS 8.
$ sudo yum -y install opera-stable
3. Wait for the installation to complete then launch the browser from the CLI:
$ opera
This article covers how to create and execute a Perl script in Linux Mint 20. Moreover, if Perl is not installed on your system already, then we have even shared with you the method of installing it on your system and also ensuring if its interpreter exists there or not.
Perl is a programming language that can be used to perform tasks that would be difficult or cumbersome on the command line. Perl is included by default with most GNU/Linux distributions.
PERL- Practical Extraction and Reporting Language (not an official acronym), is a stable and cross-platform language and was created by Larry Wall.
Perl is an open source, general-purpose, interpreted language. Programs written in Perl are called Perl scripts.
Perl supports both Procedural language and Object Oriented language and has powerful built-in support for text processing and have a collection of third-party modules. Perl language is mainly used for Web Applications, System Administration, Batch Processing, Applications which involving text processing and most command line applications.
To run a Perl script in Unix:
1. Find the interpreter/executors path. In this case its /usr/bin/perl or /usr/bin/env perl.
2. Add it to the first line of the file as #!/usr/bin/perl .
3. Give execute permission to the file chmod +x example.pl.
Features of Perl language:
1. Perl takes the best features from other languages, such as C, awk, sed, sh, and BASIC, among others.
2. Perls database integration interface DBI supports third-party databases including Oracle, Sybase, Postgres, MySQL, and others.
3. Perl works with HTML, XML, and other mark-up languages.
4. Perl supports Unicode.
5. Perl supports both procedural and object-oriented programming.
6. Perl interfaces with external C/C++ libraries through XS or SWIG.
7. Perl is extensible.
8. The Perl interpreter can be embedded into other systems.
To install Perl in Linux:
1. Before proceeding with the installation of Perl in your Linux system, please have a check Perl is installed or not on your Linux system by running the below command:
# perl -v
2. Download the zipped source code available for Unix/Linux by running the below command:
# wget https://www.cpan.org/src/5.0/perl-5.28.1.tar.gz
3. After download the zip file runs the below commands to extract and install Perl:
# tar -xzf perl-5.28.1.tar.gz
# cd perl-5.28.1
# ./Configure -de
#make
# make test
# make install
How to write your Perl script in Linux?
You can write your Perl script in a text file and the text file should have the extension '.pl'.
To run your Perl script run the below command.
#perl filename
Eg: #perl hello.pl