Accidently entered this command

i accidently entered this command export > 1.txt when I try to open that text file it shows up like this

COLORFGBG='15;0'
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus'
DESKTOP_SESSION=plasma
DISPLAY=:0
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/manmohan/.gtkrc-2.0:/home/manmohan/.config/gtkrc-2.0
GTK3_MODULES=xapp-gtk3-module
GTK_MODULES=canberra-gtk-module
GTK_RC_FILES=/etc/gtk/gtkrc:/home/manmohan/.gtkrc:/home/manmohan/.config/gtkrc
HOME=/home/manmohan
INVOCATION_ID=139e98e04b984c2db8c5a1fce1cee15f
JOURNAL_STREAM=8:24670
KDE_APPLICATIONS_AS_SCOPE=1
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=5
KONSOLE_DBUS_SERVICE=:1.101
KONSOLE_DBUS_SESSION=/Sessions/1
KONSOLE_DBUS_WINDOW=/Windows/1
KONSOLE_VERSION=220401
LANG=en_US.UTF-8
LANGUAGE=en_IN
LC_ADDRESS=en_IN
LC_IDENTIFICATION=en_IN
LC_MEASUREMENT=en_IN
LC_MONETARY=en_IN
LC_NAME=en_IN
LC_PAPER=en_IN
LC_TELEPHONE=en_IN
LC_TIME=en_IN
LESS=-R
LESS_TERMCAP_mb=$'\C-[[01;32m'
LESS_TERMCAP_md=$'\C-[[01;32m'
LESS_TERMCAP_me=$'\C-[[0m'
LESS_TERMCAP_se=$'\C-[[0m'
LESS_TERMCAP_so=$'\C-[[01;47;34m'
LESS_TERMCAP_ue=$'\C-[[0m'
LESS_TERMCAP_us=$'\C-[[01;36m'
LOGNAME=manmohan
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.swp=00;90:*.tmp=00;90:*.dpkg-dist=00;90:*.dpkg-old=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:'
LS_OPTIONS='--color=auto'
MAIL=/var/spool/mail/manmohan
MANAGERPID=716
MOTD_SHOWN=pam
OLDPWD=/home/manmohan
P9K_SSH=0
P9K_TTY=old
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
PATH=/home/manmohan/.emacs.d/bin:/home/manmohan/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin
PKGFILE_PROMPT_INSTALL_MISSING=1
PROFILEHOME=''
PWD=/home/manmohan
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
QT_SCREEN_SCALE_FACTORS='eDP-1=1;HDMI-1=1;'
SHELL=/bin/zsh
SHELL_SESSION_ID=2ae6a177d825459d8f89879cf4b6a0d2
SHLVL=1
SYSTEMD_EXEC_PID=815
TERM=xterm-256color
USER=manmohan
WINDOWID=98566151
XAUTHORITY=/home/manmohan/.Xauthority
XCURSOR_SIZE=24
XCURSOR_THEME=breeze_cursors
XDG_CONFIG_DIRS=/home/manmohan/.config/kdedefaults:/etc/xdg
XDG_CURRENT_DESKTOP=KDE
XDG_DATA_DIRS=/home/manmohan/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=KDE
XDG_SESSION_ID=2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session3
XDG_SESSION_TYPE=x11
XDG_VTNR=1
_P9K_TTY=/dev/pts/1

and I don’t know what it did, is there something i need to worry about? actually i was playing around in the terminal and entering commands that I knew but i was not sure abt this :frowning:

by the way I was trying to pipe the previous command’s output into a text file

And that’s exactly what you did.

1 Like

export simply writes out all the variables that are currently set on the system.

You now have those listed in your text file.

4 Likes

Just as a tip, when doing that, best practice is to use >> instead of just >, unless you want to overwrite an existing file.

> always truncates the file if it already exists before writing any redirected output into it. >> on the other hand appends the output to the file if it already exists.

Also keep in mind that if you do not supply an explicit relative or absolute path to the target file, the file will be created in the current working directory if it does not exist, or if it exists, then the output of the command will be redirected into said file in the current working directory — all provided that the permissions on the file and the directory themselves allow you to write to them, of course.

5 Likes

Just a clarification of terminology:

To assist in the future, there is some quick help (besides the man page man bash)

===> type -a export

export is a shell builtin

===> help  export
2 Likes