Visitantes

Powered By Blogger

Pesquisar neste Blog

Mostrando postagens com marcador Linux. Mostrar todas as postagens
Mostrando postagens com marcador Linux. Mostrar todas as postagens

sábado, 16 de setembro de 2023

Linux 40 comandos úteis

40 Useful Linux commands for Everyone:

🔖 Bookmark                                                        
        
➊ pwd

Print Working Directory

❯ pwd
# Shows the absolute path of
# the working directory

➋ mkdir

Make Directory

❯ mkdir reports/
# Creates a single directory

❯ mkdir -p reports/finance/yearly/
# Creates entire directory structure

➌ cd

Change Directory

❯ cd icons
# Switch to the "icons" directory

❯ cd -
# Switch to the previous directory

❯ cd ..
# Switch to the parent directory

❯ cd
# Switch to the home directory

➍ ls

List

❯ ls
# For current working directory

❯ ls /home/
# For /home/

❯ ls -a
# Includes hidden files

❯ ls -R
# Recursively for subdirectories

❯ ls -l
# Lists in detail

❯ ls -ltr
# Sorted. Latest modified one is at the top.

➎ cp

Copy

❯ cp file1.txt file2.txt
# Copies the file file1.txt to file2.txt

❯ cp -r dir1/ dir2/
# Copies entire directory "dir1" to "dir2"

➏ mv

Move

❯ mv file1.js images/
# Moves the file to images/

❯ mv file1.js file2.js
# Renames the file1.js to file2.js

➐ touch

❯ touch new_file
# Creates a new empty file "new_file"

❯ touch -m old_file
# Changes the modification time

➑ cat

Concatenate

⬙ It is used to view, create, and concatenate files.

❯ cat file.txt
# Lists the contents of file1.txt to std output

❯ cat > file.txt
# Creates a new file

❯ cat file1 file2 > file3
# Concatenates file1 & file2 to file3

➒ rm

Remove

❯ rm file1.txt
# Removes a file

❯ rm -r dir1
# Removes an empty directory

❯ rm -rf dir2
# Removes any directory

➓ find

Search based on a regular expression

❯ find ./ -name "xyz"
# Finds files and directories whose name is xyz

❯ find ./ -type f -name "*.java"
# Finds files whose name ends with .java

➊➊ grep

Global Regular Expression Print

❯ grep "hello" message.txt
# Lists all lines of "message.txt"
# that contain "hello"

❯ grep -c "hi" message.txt
# Outputs the number of lines in
# "message.txt" that contain "hi"

➊➋ head

❯ head message.txt
# Outputs first 10 lines of message.txt

❯ head -n 5 message.txt
# Outputs first 5 lines of message.txt

➊➌ tail

❯ tail message.txt
# Outputs last 10 lines of message.txt

❯ tail -n 5 message.txt
# Outputs last 5 lines of message.txt

❯ tail -f app.log
# Shows new entries in app.log
# as and when they get added

➊➍ diff

Difference

❯ diff /dir1/package.json /dir2/package.json
# Compare the contents of the two files
# line by line and lists out all differences

➊➎ alias

❯ alias lsa="ls -a"
# Creates a new alias "lsa" for "ls -a" command

❯ alias
# Lists all aliases for the current session

               -- More Useful Commands --

❯ echo
Displays the given text in the terminal

❯ which
Shows the directory where the command is present 

❯ whoami
Displays the username of who currently is using this session

❯ man
Displays the manual page of any command

❯ tar
Creates and extracts an archive file

❯ chmod
Changes the mode (permission) of a file

❯ chown
Changes the ownership

❯ du
Checks how much space a file or a directory takes

❯ ps
Lists the processes that the current shell session is running

❯ kill
Kills (terminates) a process

❯ free
Shows the amount of free memory

❯ vmstat 10
Every 10 seconds, show statistics

❯ iotop
Displays the disk IO usage details

❯ systemctl
Manages systemd and services

❯ journalctl
Views systemd, kernel, and journal logs

❯ env
Prints list of environment variables

❯ host
Does DNS lookup operations

❯ hostname
Obtains the DNS name

❯ ping
Checks the network connectivity b/w host and server

❯ curl
Transfers data to or from a server

❯ wget
Retrieves/downloads content from the internet

❯ history
Displays all the commands used in the past

❯ clear
Clears the terminal window

❯ sudo
Allows the current user to act as a superuser or, a root user for running a specific command

❯ exit
Ends a shell session and closes the terminal

sábado, 3 de dezembro de 2022

MX Linux

Em 2021 eu usei o MX Linux em um notebook Lenovo Thinkpad (muito velho), junto com o visual studio code, python, java, php, etc.









O MX Linux é um servidor leve, ele executa os aplicativos que são compatíveis com o Debian Linux. Ele funciona muito bem instalado em um computador velho com pouca memória RAM. Ele por ser um sistema operacional muito leve, o computador não fica muito lento. O MX Linux já vem com diversos aplicativos instalados dentro dele.



Olhe esse vídeoO que o MX Linux tem de bom ?

MX Linux download = https://mxlinux.org/download-links/




Instalando o MX Linux na configuração padrão:

user = demosenha = demo

superuser = root e password = root 




No MX Linux para desbloquear o modo de instalação dos aplicativos digita: 

sudo password root


No MX Linux para atualizar o sistema operacional digita: 

sudo apt upgrade



No MX Linux para instalar o que deseja utilizar digita:

sudo apt.get install vscode

sudo apt.get install git

sudo apt.get install html

sudo apt.get install css

sudo apt.get install javascript

sudo apt.get install node

sudo apt.get install react

sudo apt.get install angular

sudo apt.get install python

sudo apt.get install php

sudo apt.get install java

sudo apt.get install bootstrap

sudo apt.get update *.*


E para desinstalar algum aplicativo no MX Linux digita: 

sudo apt remove nomedoaplicativo

sudo ppt purge nomedoaplicativo -y


domingo, 29 de setembro de 2019

Endless OS Linux

Segue as observações do meu teste falho com o Linux Endless OS, em Julho/2019.

Em julho/2019 eu vi na internet que a ACER.COM.BR está vendendo notebooks com o sistema operacional Linux Endless OS já instalado.

Ele é bom? Alguém já experimentou esse Linux Endless OS?
#EndlessOS #Acer #Linux
hashtag Acer hashtag
https://quenotebookcomprar.com.br/notebook-acer-aspire-5-linux/

https://us.answers.acer.com/app/answers/detail/a_id/52456/~/what-is-endless-os
hashtag

Site oficial do Endless OS Linux para download = https://endlessos.com/pt-br/



Então, em Julho/2019, isso já tem uns dois meses, eu fiz o download e testei esse Linux Endless OS em um computador velho meu. E ele deu problemas na instalação desde o início, mas consegui desinstalar.



Segue abaixo o relatório dos problemas que eu encontrei na instalação do Linux Endless Os e como eu fiz para conseguir fazer a desinstalação dele com sucesso.

Eu tenho um computador velho que uso só para fazer testes, nele está instalado o Microsoft Windows Server 2019.

Segue abaixo as telas referente o ínício da instalação do Endless OS, no meu computador velho.








Logo após terminar a instalação, ele pediu para reiniciar.

Vou reiniciar e ver se está tudo normal no dual boot do Windows Server 2019 em conjunto com o Linux Endless OS.


Deu erro. Agora o Linux Endless OS pede uma senha de login que eu não tenho. Ele parou nessa tela de login que eu não tenho a senha.






Ele não deixa ler o drive de DVD, ele não deixa entrar no setup, o botão de reiniciar parou de funcionar, ele se apoderou do meu disco rígido. Tentei formatar mas ele não lê DVD nem pendrive. 

O Linux Endless OS dominou o meu computador, ele fêz o dual boot do Microsoft Windows Server 2019 parar de funcionar, o Linux EndLess OS, quer que somente ele exista dominando o computador.



Fiz uma mutreta. Liguei o disco rigido no USB, e depois disso, agora o computador voltou a ler o DVD, vou tentar instalar o Windows. Não deu certo, vou tentar outra coisa, desligar a internet.






O problema era a internet.  Eu retirei a internet do meu computador velho, e agora o DVD voltou a funcionar e o dual boot voltou a funcionar.



Vou tentar desinstalar, reiniciar, ver se vai funcionar direito depois, ver se tudo está normal no Windows





Vou tentar desinstalar e ver se ele vai funcionar direito depois






Vou reiniciar o computador e ver se o Windows vai funcionar normal depois

Vou reiniciar e ver se tudo está normal no Windows
Vou reiniciar e ver se tudo está normal no Windows




Funcionou. Com a internet desligada. Consegui desinstalar o Linux Endless OS. E depois de reiniciar o computador, o dual boot voltou a funcionar normal, e o Microsoft Windows Server 2019 voltou a funcionar no computador.

Outro dia qualquer, eu tento novamente fazer a instalação desse Linux Endless OS, e ver se ele vai funcionar. Mas da próxima vez, vou fazer a instalação pura, sem usar o dual boot.