open files from terminal ubuntu code example

Example 1: ubuntu open file from terminal

xdg-open file-name

# xdg-open myPicture.png

Example 2: how to delete files in linux

rm <file> .. rm -r <file> .. r stands for recursive

Example 3: how to open files using terminal in ubuntu

#for short files 
cat filename.txt

#for longer files
less filename.txt

#to edit files inside terminal open using vim or nano

#using vim
vim filename.txt

#using nano
nano filename.txt

Example 4: ubuntu open file system from terminal

nautilus .
#or
nautilus /home/john/Downloads

Example 5: open a file in from terminal

cat <path/your_file>

Example 6: launch bash script from application mac without opening terminal

#!/bin/bash

Tags: