How to delete a file in Linux?

< 1 min readTo delete a file in Linux, you can use the rm command followed by the name of the file you want to delete. For example: This will delete the file called file_to_delete if it exists in the current working directory. To delete a file in a different directory, you can specify the path to the…

Read More

How to remove a directory in Linux?

< 1 min readTo remove a directory in Linux, you can use the rmdir command followed by the name of the directory you want to remove. For example: This will remove the directory called directory_to_remove if it is empty. If the directory is not empty, you will get an error message saying “Directory not empty”. To remove a…

Read More

How to create a directory in Linux?

< 1 min readTo create a directory in Linux, you can use the mkdir command followed by the name of the directory you want to create. For example: This will create a new directory called new_directory in the current working directory. You can also use the -p option to create a directory and any necessary parent directories in…

Read More

How to create a symbolic link in Linux?

< 1 min readTo create a symbolic link in Linux, you can use the ln command with the -s option, followed by the target file and the link name. For example: This will create a symbolic link at /path/to/link that points to /path/to/target. You can also use the -t option to specify the directory where you want to…

Read More

How to create ssh keys in Linux?

< 1 min readTo create SSH keys in Linux, you can use the ssh-keygen command. This command will generate a public and private key pair, which you can use to securely connect to remote servers over SSH. To create an SSH key pair, open a terminal and type the following command: The ssh-keygen command will prompt you to…

Read More

How to get file size in ubuntu?

< 1 min readTo get the size of a file in Ubuntu, you can use the ls command with the -l option to show detailed information about the file, including its size. For example: This will show output similar to the following: The number at the beginning of the line is the file’s size in bytes. You can…

Read More

How to post JSON data using curl?

< 1 min readTo post JSON data using curl, you can use the curl command with the -X POST option to specify the HTTP method and the -H “Content-Type: application/json” option to set the content type to JSON. You can then pass the data you want to post as a JSON string using the -d option. Here is…

Read More

How to copy to clipboard in vim?

< 1 min readTo copy text to the clipboard in Vim, you can use the y key followed by a motion command. The y key stands for “yank” and will copy the text to the clipboard. The motion command specifies the range of text that you want to copy. For example, to copy a single line, you can…

Read More