Getting started with Linux commands

Getting started with Linux commands

History

Linux is an open-source Unix-like operating system kernel developed by Linus Torvalds and first released on September 17, 1991. It was inspired by the Unix operating system and built around the principles of free and open-source software. The Linux kernel serves as the core of many different Linux distributions, which are complete operating systems that package the kernel with various userland tools, libraries, and applications.

Linux commands are an integral part of the operating system and are used to interact with the system, manage files, configure settings, and perform various tasks.

Getting Started

Linux commands are used for manipulating files and folders

  • mkdir

    The mkdir command in Linux is used to create directories (also known as folders) in the file system. It allows users to organize their files by creating new directories to hold related files, making file management more structured and efficient.

mkdir [options] directory_name

Create multiple directories

mkdir dir1 dir2 dir3

Create a directory with parent directories

mkdir -p parent/child/grandchild

Create directories with spaces in the names

mkdir "my folder" "another folder"
  • touch

    The touch command in Linux is used to create new empty files or update the timestamp of existing files. Despite its name, the primary purpose of the command is to update file timestamps, but it's commonly used to create files if they don't already exist.

touch [options] file_name(s)

Create a new empty file

touch filename.txt

Update the timestamps of existing files (current time)

touch file1.txt file2.txt

Update timestamps with a specific date and time

touch -t 202112312359.59 myfile.txt

Create a file if it doesn't exist, or update timestamps if it does

touch my_file.txt